blob: 3af0df8487fec86117046c0fd3011bb15e5ca214 [file] [log] [blame]
Kevin Clark28580f42008-06-18 00:49:17 +00001require File.join(File.dirname(__FILE__), '../test_helper')
Mark Slee89f57162008-01-10 00:53:08 +00002require 'SmallService'
Mark Slee89f57162008-01-10 00:53:08 +00003
Kevin Clark28580f42008-06-18 00:49:17 +00004class TestStructGeneration < Test::Unit::TestCase
Mark Slee89f57162008-01-10 00:53:08 +00005
Kevin Clark28580f42008-06-18 00:49:17 +00006 def test_default_values
Kevin Clarkd5c98ee2008-06-18 00:51:45 +00007 hello = TestNamespace::Hello.new
Mark Slee89f57162008-01-10 00:53:08 +00008
Kevin Clarkd5c98ee2008-06-18 00:51:45 +00009 assert_kind_of(TestNamespace::Hello, hello)
Mark Slee89f57162008-01-10 00:53:08 +000010 assert_nil(hello.complexer)
David Reiss0c90f6f2008-02-06 22:18:40 +000011
Mark Slee89f57162008-01-10 00:53:08 +000012 assert_equal(hello.simple, 53)
13 assert_equal(hello.words, 'words')
14
Kevin Clarkd5c98ee2008-06-18 00:51:45 +000015 assert_kind_of(TestNamespace::Goodbyez, hello.thinz)
Mark Slee89f57162008-01-10 00:53:08 +000016 assert_equal(hello.thinz.val, 36632)
17
18 assert_kind_of(Hash, hello.complex)
19 assert_equal(hello.complex, { 6243 => 632, 2355 => 532, 23 => 532})
20 end
21
22 def test_goodbyez
Kevin Clarkd5c98ee2008-06-18 00:51:45 +000023 assert_equal(TestNamespace::Goodbyez.new.val, 325)
Mark Slee89f57162008-01-10 00:53:08 +000024 end
25
26end