public void Configure_DefaultValues_ConfigContainsDefaults() { //Assign var attr = new StubNodeAttribute(); var config = new NodeConfiguration(); var propertyInfo = Substitute.For<PropertyInfo>(); //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.IsNullOrEmpty(config.Path); Assert.IsNullOrEmpty(config.Id); }
public void Configure_DefaultValues_ConfigContainsDefaults() { //Assign var attr = new StubNodeAttribute(); var config = new NodeConfiguration(); var propertyInfo = Substitute.For <PropertyInfo>(); //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.IsNullOrEmpty(config.Path); Assert.IsNullOrEmpty(config.Id); }
public void Configure_DefaultValues_ConfigContainsDefaults() { //Assign var attr = new StubNodeAttribute(); var config = new NodeConfiguration(); var propertyInfo = typeof(StubItem).GetProperty("X"); //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.IsNull(config.Path); Assert.IsNull(config.Id); }
public void Configure_IdHasValue_ConfigHasIdValue() { //Assign var attr = new StubNodeAttribute(); var config = new NodeConfiguration(); var propertyInfo = Substitute.For <PropertyInfo>(); var id = "some id"; attr.Id = id; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.AreEqual(id, config.Id); Assert.IsNullOrEmpty(config.Path); }
public void Configure_PathHasValue_ConfigHasPathValue() { //Assign var attr = new StubNodeAttribute(); var config = new NodeConfiguration(); var propertyInfo = Substitute.For <PropertyInfo>(); var path = "some path"; attr.Path = path; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.AreEqual(path, config.Path); Assert.IsNullOrEmpty(config.Id); }
public void Configure_IdHasValue_ConfigHasIdValue() { //Assign var attr = new StubNodeAttribute(); var config = new NodeConfiguration(); var propertyInfo = typeof(StubItem).GetProperty("X"); var id = "some id"; attr.Id = id; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.AreEqual(id, config.Id); Assert.IsNull(config.Path); }
public void Configure_PathHasValue_ConfigHasPathValue() { //Assign var attr = new StubNodeAttribute(); var config = new NodeConfiguration(); var propertyInfo = typeof(StubItem).GetProperty("X"); var path = "some path"; attr.Path = path; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.AreEqual(path, config.Path); Assert.IsNull(config.Id); }
public void Configure_IdHasValue_ConfigHasIdValue() { //Assign var attr = new StubNodeAttribute(); var config = new NodeConfiguration(); var propertyInfo = Substitute.For<PropertyInfo>(); var id = "some id"; attr.Id = id; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.AreEqual(id, config.Id); Assert.IsNullOrEmpty(config.Path); }
public void Configure_PathHasValue_ConfigHasPathValue() { //Assign var attr = new StubNodeAttribute(); var config = new NodeConfiguration(); var propertyInfo = Substitute.For<PropertyInfo>(); var path = "some path"; attr.Path = path; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.AreEqual(path, config.Path); Assert.IsNullOrEmpty(config.Id); }