public static void DefaultEqualsWithSelf(IFoo fake, bool equals) { "Given a fake" .x(() => fake = A.Fake <IFoo>()); "When Equals is called on the fake with the fake as the argument" .x(() => equals = fake.Equals(fake)); "Then it returns true" .x(() => equals.Should().BeTrue()); }
public static void DefaultEqualsWithOtherFake(IFoo fake, IFoo otherFake, bool equals) { "Given a fake" .x(() => fake = A.Fake <IFoo>()); "And another fake of the same type" .x(() => otherFake = A.Fake <IFoo>()); "When Equals is called on the first fake with the other fake as the argument" .x(() => equals = fake.Equals(otherFake)); "Then it returns false" .x(() => equals.Should().BeFalse()); }
public static void FakeEqualsWrappedObject(Foo realObject, IFoo wrapper, bool equals) { "Given a real object" .x(() => realObject = new Foo()); "And a fake wrapping this object" .x(() => wrapper = A.Fake <IFoo>(o => o.Wrapping(realObject))); "When Equals is called on the fake with the real object as the argument" .x(() => equals = wrapper.Equals(realObject)); "Then it should return false" .x(() => equals.Should().BeFalse()); }