Exemplo n.º 1
0
        public void StaticMethodsAreIgnored()
        {
            // Fixture setup
            var fixture      = new Fixture().Customize(new AutoConfiguredNSubstituteCustomization());
            var frozenString = fixture.Freeze <string>();

            // Exercise system and verify outcome
            Assert.DoesNotThrow(() => fixture.Create <TypeWithStaticMethod>());
            Assert.NotEqual(frozenString, TypeWithStaticMethod.StaticMethod());
        }
        public void StaticMethodsAreIgnored()
        {
            // Arrange
            var fixture      = new Fixture().Customize(new AutoConfiguredNSubstituteCustomization());
            var frozenString = fixture.Freeze <string>();

            // Act & Assert
            Assert.Null(Record.Exception(() => fixture.Create <TypeWithStaticMethod>()));
            Assert.NotEqual(frozenString, TypeWithStaticMethod.StaticMethod());
        }
Exemplo n.º 3
0
        public void WithConfigureMembers_StaticMethodsAreIgnored()
        {
            // Arrange
            var fixture = new Fixture().Customize(new AutoFakeItEasyCustomization {
                ConfigureMembers = true
            });
            var frozenString = fixture.Freeze <string>();

            // Act
            fixture.Create <Fake <TypeWithStaticMethod> >();
            // Assert
            Assert.NotEqual(frozenString, TypeWithStaticMethod.StaticMethod());
        }