Exemplo n.º 1
0
        public void TestAssertVectorList_Failed(List <Vector3d> exp, List <Vector3d> act, string name,
                                                double tolerance, bool failed)
        {
            TestLists testObject = new TestLists(exp, act, name, tolerance);

            Assert.Equal(failed, testObject.Failed);
        }
Exemplo n.º 2
0
        public void TestAssertPointList_FailedInfo(List <Point3d> exp, List <Point3d> act, string name,
                                                   double tolerance, List <string> failedInfo)
        {
            TestLists testObject = new TestLists(exp, act, name, tolerance);

            Assert.Equal(failedInfo, testObject.FailedInfo);
        }
Exemplo n.º 3
0
 public TestRun()
 {
     TestLists.Add(new TestList()
     {
         Id   = TestListId,
         Name = "Results Not in a List",
     });
 }
Exemplo n.º 4
0
        public void TestAssertList_InputProperties(List <string> exp, List <string> act, string name)
        {
            TestLists testObject = new TestLists(exp, act, name);

            Assert.Equal(exp, testObject.ExpectedList);
            Assert.Equal(act, testObject.ActualList);
            Assert.Equal(name, testObject.Name);
        }
Exemplo n.º 5
0
        public void TestAssertPointList_InputProperties(List <Point3d> exp, List <Point3d> act, string name, double tolerance)
        {
            TestLists testObject = new TestLists(exp, act, name, tolerance);

            Assert.Equal(exp, testObject.ExpectedPointList);
            Assert.Equal(act, testObject.ActualPointList);
            Assert.Equal(name, testObject.Name);
            Assert.Equal(tolerance, testObject.Tolerance);
        }
Exemplo n.º 6
0
        public static void CheckListDefault(TestLists lists)
        {
            Assert.AreEqual(2, lists.List0.Count);
            Assert.AreEqual(4, lists.List1.Count);
            Assert.AreEqual(2, lists.List8.Count);
            Assert.AreEqual(2, lists.List16.Count);
            Assert.AreEqual(2, lists.List32.Count);
            Assert.AreEqual(2, lists.List64.Count);
            Assert.AreEqual(2, lists.ListP.Count);

            Assert.IsTrue(lists.List1[0].F);
            Assert.IsFalse(lists.List1[1].F);
            Assert.IsTrue(lists.List1[2].F);
            Assert.IsTrue(lists.List1[3].F);

            Assert.AreEqual(123, lists.List8[0].F);
            Assert.AreEqual(45, lists.List8[1].F);

            Assert.AreEqual(12345, lists.List16[0].F);
            Assert.AreEqual(6789, lists.List16[1].F);

            Assert.AreEqual(123456789, lists.List32[0].F);
            Assert.AreEqual(234567890, lists.List32[1].F);

            Assert.AreEqual(1234567890123456, lists.List64[0].F);
            Assert.AreEqual(2345678901234567, lists.List64[1].F);

            Assert.AreEqual("foo", lists.ListP[0].F);
            Assert.AreEqual("bar", lists.ListP[1].F);

            Assert.AreEqual(3, lists.Int32ListList.Count);
            Assert.IsTrue(lists.Int32ListList[0].SequenceEqual(new int[] { 1, 2, 3 }));
            Assert.IsTrue(lists.Int32ListList[1].SequenceEqual(new int[] { 4, 5 }));
            Assert.IsTrue(lists.Int32ListList[2].SequenceEqual(new int[] { 12341234 }));

            Assert.AreEqual(3, lists.TextListList.Count);
            Assert.IsTrue(lists.TextListList[0].SequenceEqual(new string[] { "foo", "bar" }));
            Assert.IsTrue(lists.TextListList[1].SequenceEqual(new string[] { "baz" }));
            Assert.IsTrue(lists.TextListList[2].SequenceEqual(new string[] { "qux", "corge" }));

            Assert.AreEqual(2, lists.StructListList.Count);
            Assert.AreEqual(2, lists.StructListList[0].Count);
            Assert.AreEqual(123, lists.StructListList[0][0]);
            Assert.AreEqual(456, lists.StructListList[0][1]);
            Assert.AreEqual(1, lists.StructListList[1].Count);
            Assert.AreEqual(789, lists.StructListList[1][0]);
        }
Exemplo n.º 7
0
            /// <summary>
            /// Stores property values in the respective elements, clears any
            /// lookup dictionaries.
            /// </summary>
            private void FinalizeContent()
            {
                Times.SetAttributeValue("creation", ToDateString(Created));
                Times.SetAttributeValue("queuing", ToDateString(Created));
                Times.SetAttributeValue("start", ToDateString(Started));
                Times.SetAttributeValue("finish", ToDateString(Finished));

                // Create test lists
                foreach (string list in _testLists.Keys)
                {
                    SimpleXElement test = CreateElement("TestList");
                    test.SetAttributeValue("name", list);
                    test.SetAttributeValue("id", _testLists[list].ToString());
                    TestLists.Add(test);
                }

                // Reclaim some of the memory used for element lookups
                _testLists.Clear();
            }
Exemplo n.º 8
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string        name     = "";
            List <string> expected = new List <string>();
            List <string> actual   = new List <string>();

            DA.GetData(0, ref name);
            DA.GetDataList(1, expected);
            DA.GetDataList(2, actual);

            DestroyIconCache();

            TestLists testObject = new TestLists(expected, actual, name);

            _testsFailed     = testObject.Failed;
            _unusedComponent = false;

            DA.SetData(0, testObject.Result);
            DA.SetDataList(1, testObject.FailedInfo);
        }
Exemplo n.º 9
0
        public static void InitListDefaults(TestLists lists)
        {
            lists.List0 = new TestLists.Struct0[]
            {
                new TestLists.Struct0(),
                new TestLists.Struct0()
            };
            lists.List1 = new TestLists.Struct1[]
            {
                new TestLists.Struct1()
                {
                    F = true
                },
                new TestLists.Struct1()
                {
                    F = false
                },
                new TestLists.Struct1()
                {
                    F = true
                },
                new TestLists.Struct1()
                {
                    F = true
                }
            };
            lists.List8 = new TestLists.Struct8[]
            {
                new TestLists.Struct8()
                {
                    F = 123
                },
                new TestLists.Struct8()
                {
                    F = 45
                }
            };
            lists.List16 = new TestLists.Struct16[]
            {
                new TestLists.Struct16()
                {
                    F = 12345
                },
                new TestLists.Struct16()
                {
                    F = 6789
                }
            };
            lists.List32 = new TestLists.Struct32[]
            {
                new TestLists.Struct32()
                {
                    F = 123456789
                },
                new TestLists.Struct32()
                {
                    F = 234567890
                }
            };
            lists.List64 = new TestLists.Struct64[]
            {
                new TestLists.Struct64()
                {
                    F = 1234567890123456
                },
                new TestLists.Struct64()
                {
                    F = 2345678901234567
                }
            };
            lists.ListP = new TestLists.StructP[]
            {
                new TestLists.StructP()
                {
                    F = "foo"
                },
                new TestLists.StructP()
                {
                    F = "bar"
                }
            };

            lists.Int32ListList = new int[][]
            {
                new int[] { 1, 2, 3 },
                new int[] { 4, 5 },
                new int[] { 12341234 }
            };

            lists.TextListList = new string[][]
            {
                new string[] { "foo", "bar" },
                new string[] { "baz" },
                new string[] { "qux", "corge" }
            };

            lists.StructListList = new TestAllTypes[][]
            {
                new TestAllTypes[]
                {
                    new TestAllTypes()
                    {
                        Int32Field = 123
                    },
                    new TestAllTypes()
                    {
                        Int32Field = 456
                    }
                },
                new TestAllTypes[]
                {
                    new TestAllTypes()
                    {
                        Int32Field = 789
                    }
                }
            };
        }
Exemplo n.º 10
0
        public void TestAssertVectorList_Result(List <Vector3d> exp, List <Vector3d> act, string name, double tolerance, string result)
        {
            TestLists testObject = new TestLists(exp, act, name, tolerance);

            Assert.Equal(result, testObject.Result);
        }
Exemplo n.º 11
0
        public void TestAssertList_Failed(List <string> exp, List <string> act, string name, bool failed)
        {
            TestLists testObject = new TestLists(exp, act, name);

            Assert.Equal(failed, testObject.Failed);
        }
Exemplo n.º 12
0
        public void TestAssertList_FailedInfo(List <string> exp, List <string> act, string name, List <string> failedInfo)
        {
            TestLists testObject = new TestLists(exp, act, name);

            Assert.Equal(failedInfo, testObject.FailedInfo);
        }
Exemplo n.º 13
0
        public void TestAssertList_Result(List <string> exp, List <string> act, string name, string result)
        {
            TestLists testObject = new TestLists(exp, act, name);

            Assert.Equal(result, testObject.Result);
        }