public void PropertyBagHolder_TryGetPropertyOfT_ReturnsFalseWhenPropertyDoesNotExist() { var inputObject = new TestClass(); inputObject.TryGetProperty <int>(PropertyName, out int value).Should().BeFalse(); value.Should().Be(0); }
public void PropertyBagHolder_TryGetProperty_ReturnsFalseWhenPropertyDoesNotExist() { var inputObject = new TestClass(); inputObject.TryGetProperty(PropertyName, out string value).Should().BeFalse(); value.Should().BeNull(); }
public void PropertyBagHolder_TryGetPropertyOfT_ReturnsTrueWhenPropertyExists() { var inputObject = new TestClass(); inputObject.SetProperty(PropertyName, 42); inputObject.TryGetProperty <int>(PropertyName, out int value).Should().BeTrue(); value.Should().Be(42); }
public void PropertyBagHolder_TryGetProperty_ReturnsTrueWhenPropertyExists() { var inputObject = new TestClass(); inputObject.SetProperty(PropertyName, "x"); inputObject.TryGetProperty(PropertyName, out string value).Should().BeTrue(); value.Should().Be("x"); }