summaryrefslogtreecommitdiffhomepage
path: root/test/drawing/tc_cat_axis_data.rb
blob: 23d7809065f10b5d82a915d3bd5489acfc402c9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true
# require 'tc_helper.rb'

# class TestCatAxisData < Test::Unit::TestCase

#   def setup
#     p = Axlsx::Package.new
#     @ws = p.workbook.add_worksheet
#     @chart = @ws.drawing.add_chart Axlsx::Bar3DChart
#     @series = @chart.add_series :labels=>["zero", "one", "two"]
#   end

#   def test_initialize
#     assert(@series.labels.is_a?Axlsx::SimpleTypedList)
#     assert_equal(@series.labels, ["zero", "one", "two"])
#   end

#   def test_to_xml_string
#     doc = Nokogiri::XML(@chart.to_xml_string)
#     assert_equal(doc.xpath("//c:cat/c:strRef/c:f").size,1)
#     assert_equal(doc.xpath("//c:strCache/c:ptCount[@val='#{@series.labels.size}']").size,1)
#     @series.labels.each_with_index do |label, index|
#       assert_equal(doc.xpath("//c:strCache/c:pt[@idx='#{index}']").size,1)
#       assert_equal(doc.xpath("//c:strCache/c:pt/c:v[text()='#{label}']").size,1)
#     end
#   end

# end