public void Configure_DefaultValues_ConfigSetWithDefaults() { //Act var attr = new StubFieldAttribute(); var config = new FieldConfiguration(); var propertyInfo = typeof(StubItem).GetProperty("X"); //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); // Assert.IsNullOrEmpty(config.Name); Assert.IsFalse(config.ReadOnly); }
public void Configure_ReadOnlySet_ReadOnlySetOnConfig() { //Act var attr = new StubFieldAttribute(); var config = new FieldConfiguration(); var propertyInfo = typeof(StubItem).GetProperty("X"); attr.ReadOnly = true; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); //Assert.IsNullOrEmpty(config.Name); Assert.True(config.ReadOnly); }
public void Configure_FieldNameSet_FieldNameSetOnConfig() { //Act var attr = new StubFieldAttribute(); var config = new FieldConfiguration(); var propertyInfo = typeof(StubItem).GetProperty("X"); // attr.Name = "test field name"; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); // Assert.AreEqual(attr.Name, config.Name); Assert.IsFalse(config.ReadOnly); }