예제 #1
0
        public static void FakeEqualsWrappedObjectWithValueSemantics(Bar realObject, IBar wrapper, bool equals)
        {
            "Given a real object that overrides Equals with value semantics"
            .x(() => realObject = new Bar(42));

            "And a fake wrapping this object"
            .x(() => wrapper = A.Fake <IBar>(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 true"
            .x(() => equals.Should().BeTrue());
        }