public void WhenValueIsNotNull_ThenCanReset() { var property = new Mock <PropertyDescriptor>("foo", new Attribute[0]); property.Setup(x => x.Name).Returns("Property"); property.Setup(x => x.Attributes).Returns(new AttributeCollection()); property.Setup(x => x.GetValue(It.IsAny <object>())).Returns("{ }"); var descriptor = new StringCollectionPropertyDescriptor <Model>(property.Object); Assert.True(descriptor.CanResetValue(new object())); }
public void WhenValueIsNotNull_ThenCanReset() { var property = new Mock<PropertyDescriptor>("foo", new Attribute[0]); property.Setup(x => x.Name).Returns("Property"); property.Setup(x => x.Attributes).Returns(new AttributeCollection()); property.Setup(x => x.GetValue(It.IsAny<object>())).Returns("{ }"); var descriptor = new StringCollectionPropertyDescriptor<Model>(property.Object); Assert.True(descriptor.CanResetValue(new object())); }