public void ShouldNotCreateTheSameMethodInfoTwiceInARow()
        {
            //GIVEN
            var x = Any.Instance <MethodInfo>();
            var y = Any.Instance <MethodInfo>();

            //THEN
            XAssert.NotAlike(x, y);
        }
        public void ShouldCreateDifferentExceptionEachTime()
        {
            //GIVEN
            var exception1 = Any.Instance <Exception>();
            var exception2 = Any.Instance <Exception>();

            //THEN
            XAssert.NotAlike(exception2, exception1);
        }
Exemple #3
0
        public void ShouldAllowToSkipSomePropertiesWhenComparingLikeness()
        {
            var tp1 = new TwoProp()
            {
                X1 = 123,
                X2 = 345,
                X3 = 999,
                x4 = 123
            };
            var tp2 = Clone.Of(tp1);

            tp2.X2 = 346;
            tp2.X3 = 346;
            tp2.x4 = 346;

            XAssert.Alike(tp2, tp1, "X2", "<X2>k__BackingField", "X3", "<X3>k__BackingField", "x4");
            XAssert.Alike(tp2, tp1, tp => tp.X2, tp => tp.X3, tp => tp.x4);

            tp1.X1 = 0;

            XAssert.NotAlike(tp2, tp1, "X2", "<X2>k__BackingField", "X3", "<X3>k__BackingField", "x4");
            XAssert.NotAlike(tp2, tp1, tp => tp.X2, tp => tp.X3, tp => tp.x4);
        }
Exemple #4
0
 public static T IsNotLike <T>(T expected)
 {
     return(Passing <T>(actual => XAssert.NotAlike(expected, actual)));
 }
Exemple #5
0
 public static AndConstraint <ObjectAssertions> NotBeLike(this ObjectAssertions o, object expected)
 {
     XAssert.NotAlike(expected, o.Subject);
     return(new AndConstraint <ObjectAssertions>(o));
 }