summaryrefslogtreecommitdiffhomepage
path: root/test/drawing/tc_graphic_frame.rb
blob: 30017d2b047a4bbfc9503afdc3d99a151793a8e5 (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
require 'test/unit'
require 'axlsx.rb'

class TestGraphicFrame < Test::Unit::TestCase
  def setup    
    p = Axlsx::Package.new
    @ws = p.workbook.add_worksheet
    @chart = @ws.add_chart Axlsx::Chart
    @frame = @chart.graphic_frame
  end

  def teardown
  end

  def test_initialization
    assert(@frame.anchor.is_a?(Axlsx::TwoCellAnchor))
    assert_equal(@frame.chart, @chart)
  end

  def test_rId
    assert_equal(@frame.rId, "rId1")
    chart = @ws.add_chart Axlsx::Chart
    assert_equal(chart.graphic_frame.rId, "rId2")    
  end

end