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()); }
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()); }