Ejemplo n.º 1
0
        public void FakingSupportedTypes(IFakeCreator fakeCreator, object fake)
        {
            "Given a supported fake type"
            .See(fakeCreator.FakeType.ToString());

            "When I create a fake of the supported type"
            .x(() => fake = fakeCreator.CreateFake(this));

            "Then the result is a fake"
            .x(() => Fake.GetFakeManager(fake).Should().NotBeNull());

            "And the fake is of the correct type"
            .x(() => fake.Should().BeAssignableTo(fakeCreator.FakeType));
        }
Ejemplo n.º 2
0
        public void Implements(
            IFakeCreator fakeCreator,
            Action <IFakeOptions> optionsBuilder,
            object fake)
        {
            "Given a type to fake"
            .See(() => fakeCreator.FakeType.ToString());

            "And an explicit options builder that makes a fake implement an interface"
            .x(() => optionsBuilder = options => options
                                      .Implements(typeof(IDisposable)));

            "When I create the fake using the options builder"
            .x(() => fake = fakeCreator.CreateFake(optionsBuilder, this));

            "Then it implements the interface"
            .x(() => fake.Should().BeAssignableTo <IDisposable>());
        }