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>()));
        }
Exemple #2
0
        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>()));
        }
Exemple #3
0
        public void WhenNotUsedInDictionaryValueShouldNotMatch()
        {
            var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType));

            pattern.Match(ConfOrm.ForClass <MyClass> .Property(x => x.DictionaryString)).Should().Be.False();
        }
Exemple #4
0
        public void WhenUsedInCollectionShouldMatch()
        {
            var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType));

            pattern.Match(ConfOrm.ForClass <MyClass> .Property(x => x.Enumerable)).Should().Be.True();
        }
Exemple #5
0
        public void WhenUsedInDictionaryValueShouldMatch()
        {
            var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType));

            pattern.Match(ForClass <MyClass> .Property(x => x.Dictionary)).Should().Be.True();
        }
Exemple #6
0
        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();
 }