Пример #1
0
        public static void CallToEqualsNotAllowed(
            StrictFakeOptions strictOptions,
            IMyInterface fake,
            Exception exception)
        {
            "Given a strict fake that doesn't allow calls to Equals"
            .x(() => fake = A.Fake <IMyInterface>(options =>
                                                  options.Strict(strictOptions)));

            "When I call Equals on the fake"
            .x(() => exception = Record.Exception(
                   () => fake.Equals(null)));

            "Then it should throw an exception"
            .x(() => exception.Should().BeAnExceptionOfType <ExpectationException>());
        }