2018-04-26 12:31:37 +03:00
|
|
|
require_relative "helper"
|
2015-10-13 14:46:07 +03:00
|
|
|
|
2018-04-26 12:31:37 +03:00
|
|
|
module Parfait
|
|
|
|
class TestAttributes < ParfaitTest
|
2015-10-13 14:46:07 +03:00
|
|
|
|
2018-04-26 12:31:37 +03:00
|
|
|
def setup
|
|
|
|
super
|
2018-09-01 11:24:16 +03:00
|
|
|
@mess = @space.get_next_for(:Message)
|
2018-04-26 12:31:37 +03:00
|
|
|
@type = @mess.get_type
|
|
|
|
end
|
2015-10-13 14:46:07 +03:00
|
|
|
|
2018-04-26 12:31:37 +03:00
|
|
|
def test_message_get_type
|
|
|
|
assert_equal Parfait::Type , @type.class
|
|
|
|
end
|
2016-12-16 01:14:09 +02:00
|
|
|
|
2018-04-26 12:31:37 +03:00
|
|
|
def test_message_name_nil
|
|
|
|
last = @type.names.last
|
2019-08-23 10:21:22 +03:00
|
|
|
assert_equal :local15 , last , @type.names.inspect
|
2018-07-22 22:29:32 +03:00
|
|
|
assert_nil @mess.method
|
2018-04-26 12:31:37 +03:00
|
|
|
end
|
|
|
|
def test_message_next_set
|
2019-09-09 20:29:18 +03:00
|
|
|
@mess._set_next_message :next_message
|
2018-04-26 12:31:37 +03:00
|
|
|
assert_equal :next_message , @mess.next_message
|
|
|
|
end
|
|
|
|
def test_message_type_set
|
|
|
|
@mess.set_type @type
|
|
|
|
assert_equal @type , @mess.get_type
|
|
|
|
end
|
|
|
|
def test_attribute_index
|
2019-09-09 20:29:18 +03:00
|
|
|
@mess._set_next_message :message
|
2018-04-26 12:31:37 +03:00
|
|
|
assert_equal Parfait::Type , @mess.get_type.class
|
|
|
|
end
|
2016-12-29 18:50:10 +02:00
|
|
|
|
2018-04-26 12:31:37 +03:00
|
|
|
def test_type_type
|
|
|
|
assert_equal Parfait::Type , @type.get_type.get_type.class
|
|
|
|
end
|
|
|
|
def test_type_type_type
|
|
|
|
assert_equal Parfait::Type , @type.get_type.get_type.get_type.class
|
|
|
|
end
|
2015-10-13 14:46:07 +03:00
|
|
|
end
|
|
|
|
end
|