Beispiel #1
0
        public void TestExceptWhenThrowingExceptions()
        {
            string[] firstArray  = { "Andreea", "Maria", "Ioana" };
            string[] secondArray = null;

            var result = LINQFunctions.Except(firstArray, secondArray, new EqualityComparer <string>());

            Assert.Throws <ArgumentNullException>(() => result.Count());
        }
Beispiel #2
0
        public void TestExcept()
        {
            string[] firstArray  = { "Andreea", "Maria", "Ioana" };
            string[] secondArray = { "Andreea", "Maria", "Andrei", "Ionut" };


            var exceptComparer = new EqualityComparer <string>();
            var result         = LINQFunctions.Except(firstArray, secondArray, exceptComparer);

            Assert.Equal(1, result.Count());
        }