public void GetAccessor_returns_null_when_property_is_not_bindable() { var res = new TypePropertyAccessor(typeof(ClassWithAttributes)); var accesor = res.GetAccessor(nameof(ClassWithAttributes.NotBindable)); accesor.Should().BeNull(); }
public void GetAccessor_returns_null_use_bindable_direction_for_settable_value(string propertyName, bool settable) { var res = new TypePropertyAccessor(typeof(ClassWithAttributes)); var accesor = res.GetAccessor(propertyName); accesor.IsSettable.Should().Be(settable); }
public void GetAccessor_returns_correct_object(Type type, string propertyName) { var res = new TypePropertyAccessor(type); var accesor = res.GetAccessor(propertyName); accesor.Name.Should().Be(propertyName); }
public void GetAccessor_returns_null_when_property_not_found(Type type, string propertyName) { var res = new TypePropertyAccessor(type); var accesor = res.GetAccessor(propertyName); accesor.Should().BeNull(); }
public void HasReadWriteProperties_returns_correct_property(Type type, bool expectedHasReadWriteProperties) { var res = new TypePropertyAccessor(type); res.HasReadWriteProperties.Should().Be(expectedHasReadWriteProperties); }
public void ReadProperties_returns_correct_property_position(Type type, int[] positions) { var res = new TypePropertyAccessor(type); res.ReadProperties.Select(prop => prop.Position).Should().BeEquivalentTo(positions); }
public void ReadProperties_returns_correct_property_name(Type type, string[] properties) { var res = new TypePropertyAccessor(type); res.ReadProperties.Select(prop => prop.Name).Should().BeEquivalentTo(properties); }
public void AttributeNames_returns_correct_property(Type type, string[] properties) { var res = new TypePropertyAccessor(type); res.AttributeNames.Should().BeEquivalentTo(properties); }
public void Observability_returns_correct_property(Type type, ObjectObservability expected) { var res = new TypePropertyAccessor(type); res.Observability.Should().Be(expected); }