public void ApplyShouldAlwaysSetIUserType() { var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType)); var mapper = new Mock<IElementMapper>(); pattern.Apply(null, mapper.Object); mapper.Verify(x=> x.Type(It.Is<Type>(t=> t == typeof(MyTypeUserType)), It.IsAny<object>())); }
public void ApplyShouldAlwaysSetIUserType() { var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType)); var mapper = new Mock <IElementMapper>(); pattern.Apply(null, mapper.Object); mapper.Verify(x => x.Type(It.Is <Type>(t => t == typeof(MyTypeUserType)), It.IsAny <object>())); }
public void WhenNotUsedInDictionaryValueShouldNotMatch() { var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType)); pattern.Match(ConfOrm.ForClass <MyClass> .Property(x => x.DictionaryString)).Should().Be.False(); }
public void WhenUsedInCollectionShouldMatch() { var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType)); pattern.Match(ConfOrm.ForClass <MyClass> .Property(x => x.Enumerable)).Should().Be.True(); }
public void WhenUsedInDictionaryValueShouldMatch() { var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType)); pattern.Match(ForClass <MyClass> .Property(x => x.Dictionary)).Should().Be.True(); }
public void WhenNotUsedInCollectionShouldNotMatch() { var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType)); pattern.Match(ForClass <MyClass> .Property(x => x.EnumerableString)).Should().Be.False(); }
public void WhenUsedInDictionaryValueShouldMatch() { var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType)); pattern.Match(ForClass<MyClass>.Property(x => x.Dictionary)).Should().Be.True(); }
public void WhenNotUsedInCollectionShouldNotMatch() { var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType)); pattern.Match(ForClass<MyClass>.Property(x => x.EnumerableString)).Should().Be.False(); }