Exemplo n.º 1
0
        public void HasFieldsFailsProperlyForAutoProperty()
        {
            var x = new DummyWithAutoProperty();

            x.Application = "check";
            Check.That(x).HasFieldsWithSameValues(new DummyWithAutoProperty());
        }
Exemplo n.º 2
0
        public void HasFieldsEqualWorksAgainstAnonymousClassAndAutoProperties()
        {
            var x = new DummyWithAutoProperty {
                Application = "thePrivateField"
            };

            Check.That(x).HasFieldsWithSameValues(new { Application = "thePrivateField" });
        }
Exemplo n.º 3
0
        public void HasFieldsEqualFailsForAutoPropertyWhenNegated()
        {
            var x = new DummyWithAutoProperty();

            Check.ThatCode(() => { Check.That(x).HasNotFieldsWithSameValues(new DummyWithAutoProperty()); })
            .IsAFailingCheckWithMessage(
                "",
                "The checked value's autoproperty 'Application' (field '<Application>k__BackingField') has the same value than the given one, whereas it should not.",
                "The expected value's autoproperty 'Application' (field '<Application>k__BackingField'): different from",
                "\t[null]");
        }
Exemplo n.º 4
0
        public void HasFieldsFailsProperlyForAutoPropertyForNull()
        {
            var x = new DummyWithAutoProperty();
            var y = new DummyWithAutoProperty();

            x.Application = "check";

            Check.ThatCode(() => { Check.That(y).HasFieldsWithSameValues(x); }).IsAFailingCheckWithMessage(
                "",
                "The checked value's autoproperty 'Application' (field '<Application>k__BackingField') does not have the expected value.",
                "The checked value's autoproperty 'Application' (field '<Application>k__BackingField'):",
                "\t[null] of type: [object]",
                "The expected value's autoproperty 'Application' (field '<Application>k__BackingField'):",
                "\t[\"check\"] of type: [string]");
        }
Exemplo n.º 5
0
        public void HasFieldsWithSameValuesWorksForAutoProperty()
        {
            var x = new DummyWithAutoProperty();

            Check.That(x).HasFieldsWithSameValues(new DummyWithAutoProperty());
        }
Exemplo n.º 6
0
        public void HasFieldsEqualFailsForAutoPropertyWhenNEgated()
        {
            var x = new DummyWithAutoProperty();

            Check.That(x).HasNotFieldsWithSameValues(new DummyWithAutoProperty());
        }
Exemplo n.º 7
0
 public void HasFieldsEqualFailsForAutoPropertyWhenNEgated()
 {
     var x = new DummyWithAutoProperty();
     Check.That(x).HasNotFieldsWithSameValues(new DummyWithAutoProperty());
 }
Exemplo n.º 8
0
 public void HasFieldsFailsProperlyForAutoPropertyForNull()
 {
     var x = new DummyWithAutoProperty();
     var y = new DummyWithAutoProperty();
     x.Application = "check";
     Check.That(y).HasFieldsWithSameValues(x);
 }
Exemplo n.º 9
0
        public void HasFieldsEqualWorksAgainstAnonymousClassAndAutoProperties()
        {
            var x = new DummyWithAutoProperty { Application = "toto" };

            Check.That(x).HasFieldsWithSameValues(new { Application = "toto" });
        }
Exemplo n.º 10
0
 public void HasFieldsEqualWorksForAutoProperty()
 {
     var x = new DummyWithAutoProperty();
     Check.That(x).HasFieldsWithSameValues(new DummyWithAutoProperty());
 }
Exemplo n.º 11
0
        public void HasFieldsFailsProperlyForAutoPropertyForNull()
        {
            var x = new DummyWithAutoProperty();
            var y = new DummyWithAutoProperty();
            x.Application = "check";

            Check.ThatCode(() =>
            {
                Check.That(y).HasFieldsWithSameValues(x);
            })
            .Throws<FluentCheckException>()
            .WithMessage(Environment.NewLine+ "The checked value's autoproperty 'Application' (field '<Application>k__BackingField') does not have the expected value." + Environment.NewLine + "The checked value:" + Environment.NewLine + "\t[null]" + Environment.NewLine + "The expected value:" + Environment.NewLine + "\t[\"check\"] of type: [string]");
        }
Exemplo n.º 12
0
        public void HasFieldsEqualFailsForAutoPropertyWhenNegated()
        {
            var x = new DummyWithAutoProperty();

            Check.ThatCode(() =>
            {
                Check.That(x).HasNotFieldsWithSameValues(new DummyWithAutoProperty());
            })
            .Throws<FluentCheckException>()
            .WithMessage(Environment.NewLine+ "The checked value's autoproperty 'Application' (field '<Application>k__BackingField') has the same value in the comparand, whereas it must not." + Environment.NewLine + "The expected value: different from" + Environment.NewLine + "\t[null]");
        }
Exemplo n.º 13
0
 public void HasFieldsFailsProperlyForAutoProperty()
 {
     var x = new DummyWithAutoProperty { Application = "check" };
     Check.That(x).HasFieldsWithSameValues(new DummyWithAutoProperty());
 }