public void ExecuteDoesNotSetReadonlyField() { // Arrange var sut = new AutoPropertiesCommand <ReadOnlyFieldHolder <object> >(); var specimen = new ReadOnlyFieldHolder <object>(); var unexpectedValue = new object(); var container = new DelegatingSpecimenContext { OnResolve = r => unexpectedValue }; // Act sut.Execute((object)specimen, container); // Assert Assert.NotEqual(unexpectedValue, specimen.Field); }
public void ExecuteDoesNotSetReadonlyField() { // Fixture setup var sut = new AutoPropertiesCommand <ReadOnlyFieldHolder <object> >(); var specimen = new ReadOnlyFieldHolder <object>(); var unexpectedValue = new object(); var container = new DelegatingSpecimenContext { OnResolve = r => unexpectedValue }; // Exercise system sut.Execute(specimen, container); // Verify outcome Assert.NotEqual(unexpectedValue, specimen.Field); // Teardown }
public void ExecuteDoesNotSetReadonlyField() { // Fixture setup var sut = new AutoPropertiesCommand<ReadOnlyFieldHolder<object>>(); var specimen = new ReadOnlyFieldHolder<object>(); var unexpectedValue = new object(); var container = new DelegatingSpecimenContext { OnResolve = r => unexpectedValue }; // Exercise system sut.Execute(specimen, container); // Verify outcome Assert.NotEqual(unexpectedValue, specimen.Field); // Teardown }