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>()));
        }
Ejemplo n.º 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>()));
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 5
0
        public void WhenUsedInDictionaryValueShouldMatch()
        {
            var pattern = new CustomUserTypeInCollectionElementApplier(typeof(MyType), typeof(MyTypeUserType));

            pattern.Match(ForClass <MyClass> .Property(x => x.Dictionary)).Should().Be.True();
        }
Ejemplo n.º 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();
 }