public void ShouldReturnDefaultValueIfNameNotFound() { MockProperties properties = new MockProperties(null); object defaultValue = new object(); properties.PropertiesList.Add(new MockProperty { Name = "TestName", Value = new object() }); object result = properties.GetValue("DifferentName", defaultValue); Assert.AreSame(defaultValue, result); }
public void ShouldReturnTheValueForName() { MockProperties properties = new MockProperties(null); object value = new object(); properties.PropertiesList.Add(new MockProperty { Name = "TestName", Value = value }); object result = properties.GetValue <object>("TestName", null); Assert.AreSame(value, result); }