Пример #1
0
        public void test_vector_accessor()
        {
            testAgent.btsetcurrent("par_test/vector_test");
            testAgent.resetProperties();
            testAgent.btexec();

            int Int1 = testAgent.GetVariable <int>("Int");

            Assert.AreEqual(1, Int1);

            int Int2 = testAgent.Int;

            Assert.AreEqual(1, Int2);

            int c_Int = testAgent.GetVariable <int>("c_Int");

            Assert.AreEqual(10, c_Int);

            int Int0 = testAgent.ListInts[0];

            Assert.AreEqual(110, Int0);

            int c_Count = testAgent.GetVariable <int>("c_Count");

            Assert.AreEqual(5, c_Count);

            List <int> c_ListInts = testAgent.GetVariable <List <int> >("c_ListInts");

            Assert.AreEqual(5, c_ListInts.Count);
            Assert.AreEqual(20, c_ListInts[0]);
        }
Пример #2
0
        public void test_vector_accessor()
        {
            testAgent.btsetcurrent("par_test/vector_test");
            testAgent.resetProperties();
            testAgent.btexec();

            int Int1 = testAgent.GetVariable <int>("Int");

            Assert.AreEqual(1, Int1);

            int Int2 = testAgent.Int;

            Assert.AreEqual(1, Int2);

            int c_Int = testAgent.GetVariable <int>("c_Int");

            Assert.AreEqual(10, c_Int);

            int Int0 = testAgent.ListInts[0];

            Assert.AreEqual(110, Int0);

            int c_Count = testAgent.GetVariable <int>("c_Count");

            Assert.AreEqual(5, c_Count);

            List <int> c_ListInts = testAgent.GetVariable <List <int> >("c_ListInts");

            Assert.AreEqual(5, c_ListInts.Count);
            Assert.AreEqual(20, c_ListInts[0]);

            List <double> c_douleVec = testAgent.GetVariable <List <double> >("c_douleVec");

            Assert.AreEqual(103, c_douleVec.Count);
            for (int i = 0; i < 100; ++i)
            {
                Assert.AreEqual(c_douleVec[3 + i], 0.03);
            }

            List <double> c_douleVec2 = testAgent.GetVariable <List <double> >("c_doubleVec2");

            Assert.AreEqual(103, c_douleVec2.Count);
            for (int i = 0; i < 100; ++i)
            {
                Assert.AreEqual(c_douleVec2[3 + i], 0.05);
            }
        }