public void WhenNullableEnumAlwaysApplyColumnType() { var propertyMapper = new Mock<IPropertyMapper>(); var applier = new EnumPropertyAsStringApplier(); applier.Apply(ForClass<MyClass>.Property(x => x.MyEnumNullable), propertyMapper.Object); propertyMapper.Verify(x => x.Type(It.Is<Type>(t => t == typeof(EnumStringType<MyEnum?>)), It.Is<object>(p => p == null))); }
public void WhenNullableEnumAlwaysApplyColumnType() { var propertyMapper = new Mock <IPropertyMapper>(); var applier = new EnumPropertyAsStringApplier(); applier.Apply(ForClass <MyClass> .Property(x => x.MyEnumNullable), propertyMapper.Object); propertyMapper.Verify(x => x.Type(It.Is <Type>(t => t == typeof(EnumStringType <MyEnum?>)), It.Is <object>(p => p == null))); }
public void WhenCollectionOfNoEnumThenNoMatch() { var applier = new EnumPropertyAsStringApplier(); applier.Match(ForClass <MyClass> .Property(c => c.AnyProp)).Should().Be.False(); }
public void WhenCollectionOfNoEnumThenNoMatch() { var applier = new EnumPropertyAsStringApplier(); applier.Match(ForClass<MyClass>.Property(c => c.AnyProp)).Should().Be.False(); }
public void WhenPropIsNullableEnumThenMatch() { var applier = new EnumPropertyAsStringApplier(); applier.Match(ForClass<MyClass>.Property(c => c.MyEnumNullable)).Should().Be.True(); }
public void WhenPropIsFlagNullableEnumThenNoMatch() { var applier = new EnumPropertyAsStringApplier(); applier.Match(ForClass<MyClass>.Property(c => c.MyFlagEnumNullable)).Should().Be.False(); }
public void WhenPropIsFlagNullableEnumThenNoMatch() { var applier = new EnumPropertyAsStringApplier(); applier.Match(ForClass <MyClass> .Property(c => c.MyFlagEnumNullable)).Should().Be.False(); }
public void WhenPropIsNullableEnumThenMatch() { var applier = new EnumPropertyAsStringApplier(); applier.Match(ForClass <MyClass> .Property(c => c.MyEnumNullable)).Should().Be.True(); }