Exemplo n.º 1
0
        public void View2NotMappedToViewModel2_ReverseOrder_ShouldNotBeMapped()
        {
            IDictionary <Type, Type> viewMapping = new ViewResolution().GetViewMapping(new List <Type>()
            {
                typeof(View2), typeof(ViewModel2)
            });

            Assert.Equal(0, viewMapping.Count);
        }
Exemplo n.º 2
0
        public void View1MappedToViewModel1_ReverseOrder_ShouldBeMapped()
        {
            IDictionary <Type, Type> viewMapping = new ViewResolution().GetViewMapping(new List <Type>()
            {
                typeof(View1), typeof(ViewModel1)
            });

            Assert.Equal(1, viewMapping.Count);
            Assert.True(viewMapping.Contains(new KeyValuePair <Type, Type>(typeof(ViewModel1), typeof(View1))));
        }
Exemplo n.º 3
0
        public void View1MappedToViewModel1WithDerivedSubViewModel1_ShouldReturnTwoMappings()
        {
            IDictionary <Type, Type> viewMapping = new ViewResolution().GetViewMapping(new List <Type>()
            {
                typeof(ViewModel1), typeof(SubViewModel1), typeof(View1)
            });

            Assert.Equal(2, viewMapping.Count);
            Assert.True(viewMapping.Contains(new KeyValuePair <Type, Type>(typeof(ViewModel1), typeof(View1))));
            Assert.True(viewMapping.Contains(new KeyValuePair <Type, Type>(typeof(SubViewModel1), typeof(View1))));
        }