Sha256: 973ec72458f47b6d5ec99cb3cb3014bec6c81acbd9ca0029e64ec64de59d1375

Contents?: true

Size: 1.27 KB

Versions: 8

Compression:

Stored size: 1.27 KB

Contents

require 'tc_helper.rb'

class TestView3D < Test::Unit::TestCase
  def setup
    @view  = Axlsx::View3D.new
  end

  def teardown
  end

  def test_options
    v = Axlsx::View3D.new :rotX => 10, :rotY => 5, :hPercent => "30%", :depthPercent => "45%", :rAngAx => false, :perspective => 10
    assert_equal(v.rotX, 10)
    assert_equal(v.rotY, 5)
    assert_equal(v.hPercent, "30%")
    assert_equal(v.depthPercent, "45%")
    assert_equal(v.rAngAx, false)
    assert_equal(v.perspective, 10)
  end

  def test_rotX
    assert_raise(ArgumentError) {@view.rotX = "bob"}
    assert_nothing_raised {@view.rotX = -90}
  end

  def test_rotY
    assert_raise(ArgumentError) {@view.rotY = "bob"}
    assert_nothing_raised {@view.rotY = 90}
  end

  def test_hPercent
    assert_raise(ArgumentError) {@view.hPercent = "bob"}
    assert_nothing_raised {@view.hPercent = "500%"}
  end

  def test_depthPercent
    assert_raise(ArgumentError) {@view.depthPercent = "bob"}
    assert_nothing_raised {@view.depthPercent = "20%"}
  end


  def test_rAngAx
    assert_raise(ArgumentError) {@view.rAngAx = "bob"}
    assert_nothing_raised {@view.rAngAx = true}
  end

  def test_perspective
    assert_raise(ArgumentError) {@view.perspective = "bob"}
    assert_nothing_raised {@view.perspective = 30}
  end



end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
axlsx-1.1.7 test/drawing/tc_view_3D.rb
axlsx-1.1.6 test/drawing/tc_view_3D.rb
axlsx-1.1.5 test/drawing/tc_view_3D.rb
axlsx-1.1.4 test/drawing/tc_view_3D.rb
axlsx-1.1.3 test/drawing/tc_view_3D.rb
axlsx-1.1.2 test/drawing/tc_view_3D.rb
axlsx-1.1.1 test/drawing/tc_view_3D.rb
axlsx-1.1.0 test/drawing/tc_view_3D.rb