Exemplo n.º 1
0
        public void When_instance_is_bound_then_accessor_should_access_public_property_getter()
        {
            var instanceFake = AutoFixture.Create <Example>();
            var builder      = new ReflectBuilder();

            // Act
            var accessor = builder.Bind <IExampleAccessorFixture>(instanceFake);

            // Assert
            accessor.Property.Should().Be(instanceFake.Property);
        }
Exemplo n.º 2
0
        public void When_instance_is_bound_then_accessor_should_access_private_method()
        {
            var instanceFake = AutoFixture.Create <Example>();
            var builder      = new ReflectBuilder();

            var accessor = builder.Bind <IExampleAccessorFixture>(instanceFake);

            // Act
            var result = accessor.MethodWithReturn();

            // Assert
            result.Should().Be("value");
        }