Sha256: a7f15923dfa66852453abf1946de37b5327fa4092cc21bf1be3766b9bfbfe693

Contents?: true

Size: 1.65 KB

Versions: 34

Compression:

Stored size: 1.65 KB

Contents

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

class TestPositionObject < Test::Unit::TestCase
  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

34 entries across 34 versions & 1 rubygems

Version Path
write_xlsx-0.86.0 test/worksheet/test_position_object.rb
write_xlsx-0.85.11 test/worksheet/test_position_object.rb
write_xlsx-0.85.10 test/worksheet/test_position_object.rb
write_xlsx-0.85.9 test/worksheet/test_position_object.rb
write_xlsx-0.85.8 test/worksheet/test_position_object.rb
write_xlsx-0.85.7 test/worksheet/test_position_object.rb
write_xlsx-0.85.6 test/worksheet/test_position_object.rb
write_xlsx-0.85.5 test/worksheet/test_position_object.rb
write_xlsx-0.85.4 test/worksheet/test_position_object.rb
write_xlsx-0.85.3 test/worksheet/test_position_object.rb
write_xlsx-0.85.2 test/worksheet/test_position_object.rb
write_xlsx-0.85.1 test/worksheet/test_position_object.rb
write_xlsx-0.83.0 test/worksheet/test_position_object.rb
write_xlsx-0.81.1 test/worksheet/test_position_object.rb
write_xlsx-0.81.0 test/worksheet/test_position_object.rb
write_xlsx-0.80.0 test/worksheet/test_position_object.rb
write_xlsx-0.79.0 test/worksheet/test_position_object.rb
write_xlsx-0.78.0 test/worksheet/test_position_object.rb
write_xlsx-0.77.2 test/worksheet/test_position_object.rb
write_xlsx-0.77.1 test/worksheet/test_position_object.rb