public void SetDefaultsOnlyPropertiesWithDefaultValueAttribute() { // Arrange var config = new TestConfig1(); // Act ValueProviderExecutor.Execute(config, new ValueProviderExecutorSettings().AddDefaultValueProvider()); //Assert Assert.AreEqual(25, config.DummyNumber2); }
public void UseNoValueProviderLeadsToNoChanges() { // Arrange var config = new TestConfig1(); // Act ValueProviderExecutor.Execute(config, new ValueProviderExecutorSettings()); // Assert Assert.AreEqual(0, config.DummyNumber); Assert.AreEqual(1024, config.DummyNumberReadOnly); Assert.AreEqual(25, config.DummyNumber2); Assert.IsNull(config.DummyText); }
public void SetDefaultsOnlyOnWritableProperties() { // Arrange var config = new TestConfig1(); // Act ValueProviderExecutor.Execute(config, new ValueProviderExecutorSettings().AddDefaultValueProvider()); // Assert Assert.AreEqual(DefaultValues.Number, config.DummyNumber); Assert.AreEqual(1024, config.DummyNumberReadOnly); Assert.AreEqual(25, config.DummyNumber2); Assert.AreEqual(DefaultValues.Text, config.DummyText); }