예제 #1
0
        public void par_test_ref_in()
        {
            parTestAgent.btsetcurrent("par_test/par_as_ref_param");
            parTestAgent.resetProperties();
            parTestAgent.btexec();

            // base class 0 test
            eColor ecolor_0 = parTestAgent.GetVariable <eColor>("par0_ecolor_0");

            Assert.AreEqual(eColor.BLUE, ecolor_0);

            Boolean boolean_0 = parTestAgent.GetVariable <Boolean>("par0_boolean_0");

            Assert.AreEqual(true, boolean_0);

            Char char_0 = parTestAgent.GetVariable <Char>("par0_char_0");

            Assert.AreEqual('X', char_0);

            Byte byte_0 = parTestAgent.GetVariable <Byte>("par0_byte_0");

            Assert.AreEqual(2, byte_0);

            List <Byte> byte_list_0 = parTestAgent.GetVariable <List <Byte> >("par0_byte_list_0");

            Assert.AreEqual(1, byte_list_0.Count);
            Assert.AreEqual(8, byte_list_0[0]);

            SByte sbyte_0 = parTestAgent.GetVariable <SByte>("par0_sbyte_0");

            Assert.AreEqual(-2, sbyte_0);

            List <eColor> ecolor_list_0 = parTestAgent.GetVariable <List <eColor> >("par0_ecolor_list_0");

            Assert.AreEqual(1, ecolor_list_0.Count);
            Assert.AreEqual(eColor.RED, ecolor_list_0[0]);

            List <Boolean> boolean_list_0 = parTestAgent.GetVariable <List <Boolean> >("par0_boolean_list_0");

            Assert.AreEqual(1, boolean_list_0.Count);
            Assert.AreEqual(true, boolean_list_0[0]);

            List <Char> char_list_0 = parTestAgent.GetVariable <List <Char> >("par0_char_list_0");

            Assert.AreEqual(1, char_list_0.Count);
            Assert.AreEqual('k', char_list_0[0]);

            List <SByte> sbyte_list_0 = parTestAgent.GetVariable <List <SByte> >("par0_sbyte_list_0");

            Assert.AreEqual(1, sbyte_list_0.Count);
            Assert.AreEqual(-4, sbyte_list_0[0]);

            // base class 1 test
            short short_0 = parTestAgent.GetVariable <short>("par1_short_0");

            Assert.AreEqual(1, short_0);

            int int_0 = parTestAgent.GetVariable <int>("par1_int_0");

            Assert.AreEqual(2, int_0);

            long long_0 = parTestAgent.GetVariable <long>("par1_long_0");

            Assert.AreEqual(3L, long_0);

            ushort ushort_0 = parTestAgent.GetVariable <ushort>("par1_ushort_0");

            Assert.AreEqual(4, ushort_0);

            kEmployee kemployee_0 = parTestAgent.GetVariable <kEmployee>("par1_kemployee_0");

            Assert.AreEqual(3, kemployee_0.id);
            Assert.AreEqual("Tom", kemployee_0.name);
            Assert.AreEqual('X', kemployee_0.code);
            Assert.AreEqual(58.7f, kemployee_0.weight);
            Assert.AreEqual(true, kemployee_0.isMale);
            Assert.AreEqual(eColor.GREEN, kemployee_0.skinColor);
            Assert.AreEqual(parTestAgent, kemployee_0.boss);
            Assert.AreEqual("Honda", kemployee_0.car.brand);
            Assert.AreEqual(eColor.RED, kemployee_0.car.color);
            Assert.AreEqual(23000, kemployee_0.car.price);

            List <int> int_list_0 = parTestAgent.GetVariable <List <int> >("par1_int_list_0");

            Assert.AreEqual(1, int_list_0.Count);
            Assert.AreEqual(5, int_list_0[0]);

            List <kEmployee> kemployee_list_0 = parTestAgent.GetVariable <List <kEmployee> >("par1_kemployee_list_0");

            Assert.AreEqual(1, kemployee_list_0.Count);
            Assert.AreEqual(3, kemployee_list_0[0].id);
            Assert.AreEqual("Tom", kemployee_list_0[0].name);
            Assert.AreEqual('X', kemployee_list_0[0].code);
            Assert.AreEqual(58.7f, kemployee_list_0[0].weight);
            Assert.AreEqual(true, kemployee_list_0[0].isMale);
            Assert.AreEqual(eColor.GREEN, kemployee_list_0[0].skinColor);
            Assert.AreEqual(parTestAgent, kemployee_list_0[0].boss);
            Assert.AreEqual("Honda", kemployee_list_0[0].car.brand);
            Assert.AreEqual(eColor.RED, kemployee_list_0[0].car.color);
            Assert.AreEqual(23000, kemployee_list_0[0].car.price);

            // base class 2 test
            uint uint_0 = parTestAgent.GetVariable <uint>("par2_uint_0");

            Assert.AreEqual(1, uint_0);

            ulong ulong_0 = parTestAgent.GetVariable <ulong>("par2_ulong_0");

            Assert.AreEqual(2, ulong_0);

            Single single_0 = parTestAgent.GetVariable <Single>("par2_single_0");

            Assert.AreEqual(3.0f, single_0);

            Double double_0 = parTestAgent.GetVariable <Double>("par2_double_0");

            Assert.AreEqual(4.0, double_0);

            long ll_0 = parTestAgent.GetVariable <long>("par2_longlong_0");

            Assert.AreEqual(-866L, ll_0);

            ulong ull_0 = parTestAgent.GetVariable <ulong>("par2_ulonglong_0");

            Assert.AreEqual(866L, ull_0);

            Assert.AreEqual("this is const char* test", parTestAgent.TV_CSzString);
            Assert.AreEqual("this is char* test", parTestAgent.TV_SzString_0);

            String string_0 = parTestAgent.GetVariable <String>("par2_string_0");

            Assert.AreEqual("This is a string ref in test!", string_0);

            Agent agent_0 = parTestAgent.GetVariable <Agent>("par2_agent_0");

            Assert.AreEqual(parTestAgent, agent_0);

            List <Single> single_list_0 = parTestAgent.GetVariable <List <Single> >("par2_single_list_0");

            Assert.AreEqual(1, single_list_0.Count);
            Assert.AreEqual(1.0f, single_list_0[0]);

            List <String> string_list_0 = parTestAgent.GetVariable <List <String> >("par2_string_list_0");

            Assert.AreEqual(1, string_list_0.Count);
            Assert.AreEqual("This is a string ref in test!", string_list_0[0]);

            List <Agent> agent_list_0 = parTestAgent.GetVariable <List <Agent> >("par2_agent_list_0");

            Assert.AreEqual(1, agent_list_0.Count);
            Assert.AreEqual(parTestAgent, agent_list_0[0]);
        }
예제 #2
0
        public void par_test_ref_in()
        {
            parTestAgent.btsetcurrent("par_test/par_as_ref_param");
            parTestAgent.resetProperties();
            parTestAgent.btexec();

            // base class 0 test
            eColor ecolor_0 = parTestAgent.GetVariable <eColor>("par0_ecolor_0");

            Assert.AreEqual(eColor.BLUE, ecolor_0);

            Boolean boolean_0 = parTestAgent.GetVariable <Boolean>("par0_boolean_0");

            Assert.AreEqual(true, boolean_0);

            Char char_0 = parTestAgent.GetVariable <Char>("par0_char_0");

            Assert.AreEqual('X', char_0);

            Byte byte_0 = parTestAgent.GetVariable <Byte>("par0_byte_0");

            Assert.AreEqual(2, byte_0);

            List <Byte> byte_list_0 = parTestAgent.GetVariable <List <Byte> >("par0_byte_list_0");

            Assert.AreEqual(1, byte_list_0.Count);
            Assert.AreEqual(8, byte_list_0[0]);

            SByte sbyte_0 = parTestAgent.GetVariable <SByte>("par0_sbyte_0");

            Assert.AreEqual(-2, sbyte_0);

            List <eColor> ecolor_list_0 = parTestAgent.GetVariable <List <eColor> >("par0_ecolor_list_0");

            Assert.AreEqual(1, ecolor_list_0.Count);
            Assert.AreEqual(eColor.RED, ecolor_list_0[0]);

            List <Boolean> boolean_list_0 = parTestAgent.GetVariable <List <Boolean> >("par0_boolean_list_0");

            Assert.AreEqual(1, boolean_list_0.Count);
            Assert.AreEqual(true, boolean_list_0[0]);

            List <Char> char_list_0 = parTestAgent.GetVariable <List <Char> >("par0_char_list_0");

            Assert.AreEqual(1, char_list_0.Count);
            Assert.AreEqual('k', char_list_0[0]);

            List <SByte> sbyte_list_0 = parTestAgent.GetVariable <List <SByte> >("par0_sbyte_list_0");

            Assert.AreEqual(1, sbyte_list_0.Count);
            Assert.AreEqual(-4, sbyte_list_0[0]);

            // base class 1 test
            Int16 int16_0 = parTestAgent.GetVariable <Int16>("par1_int16_0");

            Assert.AreEqual(1, int16_0);

            Int32 int32_0 = parTestAgent.GetVariable <Int32>("par1_int32_0");

            Assert.AreEqual(2, int32_0);

            Int64 int64_0 = parTestAgent.GetVariable <Int64>("par1_int64_0");

            Assert.AreEqual(3L, int64_0);

            UInt16 uint16_0 = parTestAgent.GetVariable <UInt16>("par1_uint16_0");

            Assert.AreEqual(4, uint16_0);

            kEmployee kemployee_0 = parTestAgent.GetVariable <kEmployee>("par1_kemployee_0");

            Assert.AreEqual(3, kemployee_0.id);
            Assert.AreEqual("Tom", kemployee_0.name);
            Assert.AreEqual('X', kemployee_0.code);
            Assert.AreEqual(58.7f, kemployee_0.weight);
            Assert.AreEqual(true, kemployee_0.isMale);
            Assert.AreEqual(eColor.GREEN, kemployee_0.skinColor);
            Assert.AreEqual(parTestAgent, kemployee_0.boss);
            Assert.AreEqual("Honda", kemployee_0.car.brand);
            Assert.AreEqual(eColor.RED, kemployee_0.car.color);
            Assert.AreEqual(23000, kemployee_0.car.price);

            List <Int32> int32_list_0 = parTestAgent.GetVariable <List <Int32> >("par1_int32_list_0");

            Assert.AreEqual(1, int32_list_0.Count);
            Assert.AreEqual(5, int32_list_0[0]);

            List <kEmployee> kemployee_list_0 = parTestAgent.GetVariable <List <kEmployee> >("par1_kemployee_list_0");

            Assert.AreEqual(1, kemployee_list_0.Count);
            Assert.AreEqual(3, kemployee_list_0[0].id);
            Assert.AreEqual("Tom", kemployee_list_0[0].name);
            Assert.AreEqual('X', kemployee_list_0[0].code);
            Assert.AreEqual(58.7f, kemployee_list_0[0].weight);
            Assert.AreEqual(true, kemployee_list_0[0].isMale);
            Assert.AreEqual(eColor.GREEN, kemployee_list_0[0].skinColor);
            Assert.AreEqual(parTestAgent, kemployee_list_0[0].boss);
            Assert.AreEqual("Honda", kemployee_list_0[0].car.brand);
            Assert.AreEqual(eColor.RED, kemployee_list_0[0].car.color);
            Assert.AreEqual(23000, kemployee_list_0[0].car.price);

            // base class 2 test
            UInt32 uint32_0 = parTestAgent.GetVariable <UInt32>("par2_uint32_0");

            Assert.AreEqual(1, uint32_0);

            UInt64 uint64_0 = parTestAgent.GetVariable <UInt64>("par2_uint64_0");

            Assert.AreEqual(2, uint64_0);

            Single single_0 = parTestAgent.GetVariable <Single>("par2_single_0");

            Assert.AreEqual(3.0f, single_0);

            Double double_0 = parTestAgent.GetVariable <Double>("par2_double_0");

            Assert.AreEqual(4.0, double_0);

            String string_0 = parTestAgent.GetVariable <String>("par2_string_0");

            Assert.AreEqual("This is a string ref in test!", string_0);

            Agent agent_0 = parTestAgent.GetVariable <Agent>("par2_agent_0");

            Assert.AreEqual(parTestAgent, agent_0);

            List <Single> single_list_0 = parTestAgent.GetVariable <List <Single> >("par2_single_list_0");

            Assert.AreEqual(1, single_list_0.Count);
            Assert.AreEqual(1.0f, single_list_0[0]);

            List <String> string_list_0 = parTestAgent.GetVariable <List <String> >("par2_string_list_0");

            Assert.AreEqual(1, string_list_0.Count);
            Assert.AreEqual("This is a string ref in test!", string_list_0[0]);

            List <Agent> agent_list_0 = parTestAgent.GetVariable <List <Agent> >("par2_agent_list_0");

            Assert.AreEqual(1, agent_list_0.Count);
            Assert.AreEqual(parTestAgent, agent_list_0[0]);
        }