Sha256: da408837f2407de6ec9c64a4bb9e46549ec89149554ceb356ae5801d816708df

Contents?: true

Size: 1.65 KB

Versions: 19

Compression:

Stored size: 1.65 KB

Contents

# -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx'
require 'stringio'

class TestPositionObject < Minitest::Test
  def setup
    @workbook = WriteXLSX.new(StringIO.new)
    @worksheet = @workbook.add_worksheet('')
  end

  def test_position_object_emus_01
    result = @worksheet.__send__("position_object_emus", 4, 8, 0, 0, 480, 288)
    expected = [4, 8, 0, 0, 11, 22, 304800, 76200, 2438400, 1524000]
    assert_equal(expected, result)
  end

  def test_position_object_emus_02
    @worksheet.set_column('L:L', 3.86)
    result = @worksheet.__send__("position_object_emus", 4, 8, 0, 0, 480, 288)
    expected = [4, 8, 0, 0, 12, 22, 0, 76200, 2438400, 1524000]
    assert_equal(expected, result)
  end

  def test_position_object_emus_03
    @worksheet.set_column('L:L', 3.86)
    @worksheet.set_row(22, 6)
    result = @worksheet.__send__("position_object_emus", 4, 8, 0, 0, 480, 288)
    expected = [4, 8, 0, 0, 12, 23, 0, 0, 2438400, 1524000]
    assert_equal(expected, result)
  end

  def test_position_object_emus_04
    result = @worksheet.__send__("position_object_emus", 4, 8, 0, 0, 32, 32)
    expected = [4, 8, 0, 0, 4, 9, 304800, 114300, 2438400, 1524000]
    assert_equal(expected, result)
  end

  def test_position_object_emus_05
    result = @worksheet.__send__("position_object_emus", 4, 8, 2, 3, 72, 72)
    expected = [4, 8, 19050, 28575, 5, 11, 95250, 142875, 2457450, 1552575]
    assert_equal(expected, result)
  end

  def test_position_object_emus_06
    result = @worksheet.__send__("position_object_emus", 5, 1, 2, 3, 99, 69)
    expected = [5, 1, 19050, 28575, 6, 4, 352425, 114300, 3067050, 219075]
    assert_equal(expected, result)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
write_xlsx-1.09.4 test/worksheet/test_position_object.rb
write_xlsx-1.09.3 test/worksheet/test_position_object.rb
write_xlsx-1.09.2 test/worksheet/test_position_object.rb
write_xlsx-1.09.1 test/worksheet/test_position_object.rb
write_xlsx-1.09.0 test/worksheet/test_position_object.rb
write_xlsx-1.08.2 test/worksheet/test_position_object.rb
write_xlsx-1.08.1 test/worksheet/test_position_object.rb
write_xlsx-1.08.0 test/worksheet/test_position_object.rb
write_xlsx-1.07.0 test/worksheet/test_position_object.rb
write_xlsx-1.04.0 test/worksheet/test_position_object.rb
write_xlsx-1.02.0 test/worksheet/test_position_object.rb
write_xlsx-1.01.0 test/worksheet/test_position_object.rb
write_xlsx-1.00.0 test/worksheet/test_position_object.rb
write_xlsx-0.99.0 test/worksheet/test_position_object.rb
write_xlsx-0.97.0 test/worksheet/test_position_object.rb
write_xlsx-0.90.0 test/worksheet/test_position_object.rb
write_xlsx-0.89.0 test/worksheet/test_position_object.rb
write_xlsx-0.88.0 test/worksheet/test_position_object.rb
write_xlsx-0.87.0 test/worksheet/test_position_object.rb