Class: ODDB::OdbaExporter::TestAcpricealgPublicLine

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
FlexMock::TestCase
Defined in:
ext/export/test/test_oddbdat.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



288
289
290
291
292
293
294
# File 'ext/export/test/test_oddbdat.rb', line 288

def setup
  @package = ODDB::Package.new('12')
  @package.price_public = 123.45
  flexstub(@package).should_receive(:oid).and_return(123)
  flexstub(Date).should_receive(:"today.strftime").and_return('20110203000000')
  @acpriceline = AcpricealgPublicLine.new(@package)
end

- (Object) test_price_public_type



295
296
297
298
299
# File 'ext/export/test/test_oddbdat.rb', line 295

def test_price_public_type
  assert_equal('PPUB', @acpriceline.price_public_type)
  @package.create_sl_entry
  assert_equal('PSL2', @acpriceline.price_public_type)
end

- (Object) test_structure



300
301
302
303
304
305
306
307
308
309
310
# File 'ext/export/test/test_oddbdat.rb', line 300

def test_structure
  expected = {
    1=>"07", 
    2=>"20110203000000", 
    3=>123, 
    4=>"PPUB",
    5=>"4", 
    6=>"123.45", 
  }
  assert_equal(expected.sort, @acpriceline.structure.sort)
end