public void GetValueForProperty_works() { var obj = new CloneClass(1, "string1", DateTime.Now, true, 1.1M, typeof(CloneClass)); obj.GetValueForProperty("TheInt").Should().Be(obj.TheInt); obj.GetValueForProperty("TheString").Should().Be(obj.TheString); obj.GetValueForProperty("TheDateTime").Should().Be(obj.TheDateTime); obj.GetValueForProperty("TheBool").Should().Be(obj.TheBool); obj.GetValueForProperty("TheDecimal").Should().Be(obj.TheDecimal); obj.GetValueForProperty("TheType").Should().Be(obj.TheType); }
public void GetValueForProperty_returns_defaultValue_when_property_doesnt_exist() { var obj = new CloneClass(); obj.GetValueForProperty("NonExistantProperty").Should().BeNull(); obj.GetValueForProperty("NonExistantProperty", "doesnt exist").Should().Be("doesnt exist"); }