public void HasFieldsFailsProperlyForAutoProperty() { var x = new DummyWithAutoProperty(); x.Application = "check"; Check.That(x).HasFieldsWithSameValues(new DummyWithAutoProperty()); }
public void HasFieldsEqualWorksAgainstAnonymousClassAndAutoProperties() { var x = new DummyWithAutoProperty { Application = "thePrivateField" }; Check.That(x).HasFieldsWithSameValues(new { Application = "thePrivateField" }); }
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]"); }
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]"); }
public void HasFieldsWithSameValuesWorksForAutoProperty() { var x = new DummyWithAutoProperty(); Check.That(x).HasFieldsWithSameValues(new DummyWithAutoProperty()); }
public void HasFieldsEqualFailsForAutoPropertyWhenNEgated() { var x = new DummyWithAutoProperty(); Check.That(x).HasNotFieldsWithSameValues(new DummyWithAutoProperty()); }
public void HasFieldsFailsProperlyForAutoPropertyForNull() { var x = new DummyWithAutoProperty(); var y = new DummyWithAutoProperty(); x.Application = "check"; Check.That(y).HasFieldsWithSameValues(x); }
public void HasFieldsEqualWorksAgainstAnonymousClassAndAutoProperties() { var x = new DummyWithAutoProperty { Application = "toto" }; Check.That(x).HasFieldsWithSameValues(new { Application = "toto" }); }
public void HasFieldsEqualWorksForAutoProperty() { var x = new DummyWithAutoProperty(); Check.That(x).HasFieldsWithSameValues(new DummyWithAutoProperty()); }
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]"); }
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]"); }
public void HasFieldsFailsProperlyForAutoProperty() { var x = new DummyWithAutoProperty { Application = "check" }; Check.That(x).HasFieldsWithSameValues(new DummyWithAutoProperty()); }