示例#1
0
        public void TestInequal_WithNullUnequals_ShouldThrow()
        {
            var subject = new object();

            Assert.Throws <ArgumentNullException>(
                "unequals",
                () => Subject.TestInequal(subject, (IEnumerable <Func <object, object> >)null));

            Assert.Throws <ArgumentNullException>(
                "unequals",
                () => Subject.TestInequal(subject, (IEnumerable <object>)null));
        }
示例#2
0
        public void TestInequal_WithNullSubject_ShouldThrow()
        {
            Assert.Throws <ArgumentNullException>(
                "subject",
                () => Subject.TestInequal(null, (object s) => new object()));

            Assert.Throws <ArgumentNullException>(
                "subject",
                () => Subject.TestInequal((object)null, Enumerable.Empty <Func <object, object> >()));

            Assert.Throws <ArgumentNullException>(
                "subject",
                () => Subject.TestInequal(null, Enumerable.Empty <object>()));
        }
示例#3
0
        public void TestInequal_WithNonEmptyUnequals_ShouldReturnInequalityResultForEachItem()
        {
            var result1 = Subject.TestInequal(1, s => 1, s => 2);
            var result2 = Subject.TestInequal(1, new[] { 1, 2 });

            Assert.Collection(
                result1,
                r => Assert.False(r),
                r => Assert.False(r),
                r => Assert.True(r),
                r => Assert.False(r));

            Assert.Collection(
                result2,
                r => Assert.False(r),
                r => Assert.False(r),
                r => Assert.True(r),
                r => Assert.False(r));
        }