예제 #1
0
        public void TestExistingDuplicates()
        {
            ExactSearch <Vector> es = new ExactSearch <Vector>(_tree.Root);
            IEnumerable <Vector> en = es.FindExact(Vector.Create(1.0, 5.0));

            Assert.IsTrue(VectorComparison.Equal(Numbered.First(en), Vector.Create(1.0, 5.0)));
            Assert.IsTrue(VectorComparison.Equal(Numbered.Second(en), Vector.Create(1.0, 5.0)));
            Assert.IsTrue(VectorComparison.Equal(Numbered.Third(en), Vector.Create(1.0, 5.0)));
        }
예제 #2
0
        public void TestFirstSecondThird()
        {
            int[] numbers = new int[] { 3, 6, 8, 10, 12, 14 };
            Assert.AreEqual(3, Accelerators.Numbered.First(numbers));
            Assert.AreEqual(6, Accelerators.Numbered.Second(numbers));
            Assert.AreEqual(8, Accelerators.Numbered.Third(numbers));

            numbers = new int[] {};
            NUnitExtensions.Assert.Throws(typeof(InvalidOperationException), delegate { Numbered.First(numbers); });
            NUnitExtensions.Assert.Throws(typeof(InvalidOperationException), delegate { Numbered.Second(numbers); });
            NUnitExtensions.Assert.Throws(typeof(InvalidOperationException), delegate { Numbered.Third(numbers); });
        }