Sha256: e2c705a264eb4f3d98c6648ab05b826b5ccbb9d26ba37cea3552afd2436478d9

Contents?: true

Size: 870 Bytes

Versions: 8

Compression:

Stored size: 870 Bytes

Contents

require 'tc_helper.rb'

class TestPie3DChart < Test::Unit::TestCase

  def setup
    p = Axlsx::Package.new
    ws = p.workbook.add_worksheet
    @row = ws.add_row ["one", 1, Time.now]
    @chart = ws.drawing.add_chart Axlsx::Pie3DChart, :title => "fishery"
  end

  def teardown
  end

  def test_initialization
    assert_equal(@chart.view3D.rotX, 30, "view 3d default rotX incorrect")
    assert_equal(@chart.view3D.perspective, 30, "view 3d default perspective incorrect")
    assert_equal(@chart.series_type, Axlsx::PieSeries, "series type incorrect")
  end

  def test_to_xml
    schema = Nokogiri::XML::Schema(File.open(Axlsx::DRAWING_XSD))
    doc = Nokogiri::XML(@chart.to_xml_string)
    errors = []
    schema.validate(doc).each do |error|
      errors.push error
      puts error.message
    end
    assert(errors.empty?, "error free validation")
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

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