public void Configure_IsLazyByDefault_IsLazyConfigTrue() { //Assign var attr = new StubChildrenAttribute(); var config = new ChildrenConfiguration(); var propertyInfo = typeof(StubItem).GetProperty("X"); //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.IsTrue(config.IsLazy); Assert.IsFalse(config.InferType); }
public void Configure_IsLazyByDefault_IsLazyConfigTrue() { //Assign var attr = new StubChildrenAttribute(); var config = new ChildrenConfiguration(); var propertyInfo = Substitute.For <PropertyInfo>(); //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.IsTrue(config.IsLazy); Assert.IsFalse(config.InferType); }
public void Configure_InferTypeSet_InferTypeSetOnConfig() { //Assign var attr = new StubChildrenAttribute(); var config = new ChildrenConfiguration(); var propertyInfo = typeof(StubItem).GetProperty("X"); attr.InferType = true; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.IsTrue(config.InferType); }
public void Configure_InferTypeSet_InferTypeSetOnConfig() { //Assign var attr = new StubChildrenAttribute(); var config = new ChildrenConfiguration(); var propertyInfo = Substitute.For<PropertyInfo>(); attr.InferType = true; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.IsTrue(config.IsLazy); Assert.IsTrue(config.InferType); }
public void Configure_IsLazySetToFalse_IsLazyConfigFalse() { //Assign var attr = new StubChildrenAttribute(); var config = new ChildrenConfiguration(); var propertyInfo = typeof(StubItem).GetProperty("X"); attr.IsLazy = false; //Act attr.Configure(propertyInfo, config); //Assert Assert.AreEqual(propertyInfo, config.PropertyInfo); Assert.IsFalse(config.IsLazy); Assert.IsFalse(config.InferType); }