protected static void CreateClassDefs <T1, T2>()
        {
            CustomTypeSource typeSource = new CustomTypeSource();

            typeSource.Add <T1>();
            typeSource.Add <T2>();
            AllClassesAutoMapper.ClassDefCol = ClassDef.ClassDefs;
            new AllClassesAutoMapper(typeSource).Map();
        }
 public void Test_AddGeneric_ShouldReturnAllTypesAdded()
 {
     //---------------Set up test pack-------------------
     CustomTypeSource typeSource = new CustomTypeSource();
    
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     typeSource.Add <FakeExtBoShouldBeLoaded>();
     //---------------Test Result -----------------------
     var bos = typeSource.GetTypes();
     Assert.AreEqual(1, bos.Count());
     bos.ShouldContain(wrapper => wrapper.Name == "FakeExtBoShouldBeLoaded");
 }
示例#3
0
        public void Test_AddGeneric_ShouldReturnAllTypesAdded()
        {
            //---------------Set up test pack-------------------
            CustomTypeSource typeSource = new CustomTypeSource();

            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            typeSource.Add <FakeExtBoShouldBeLoaded>();
            //---------------Test Result -----------------------
            var bos = typeSource.GetTypes();

            Assert.AreEqual(1, bos.Count());
            bos.ShouldContain(wrapper => wrapper.Name == "FakeExtBoShouldBeLoaded");
        }
示例#4
0
        public void Test_ConstructWithList_ShouldReturnAllTypesAdded()
        {
            //---------------Set up test pack-------------------
            Type type1 = typeof(FakeExtBoShouldBeLoaded);
            Type type2 = typeof(FakeExtGenericBOShouldNotBeLoaded <string>);
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            CustomTypeSource typeSource = new CustomTypeSource(new[] { type1, type2 });
            //---------------Test Result -----------------------
            var bos = typeSource.GetTypes();

            Assert.AreEqual(2, bos.Count());
            bos.ShouldContain(wrapper => wrapper.Name == type1.Name);
            bos.ShouldContain(wrapper => wrapper.Name == type2.Name);
        }
 public void Test_AddList_ShouldReturnAllTypesAdded()
 {
     //---------------Set up test pack-------------------
     CustomTypeSource typeSource = new CustomTypeSource();
     Type type1 = typeof(FakeExtBoShouldBeLoaded);
     Type type2 = typeof(FakeExtAbstractBoInterfaceShouldNotBeLoaded);
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     typeSource.Add(new []{type1, type2});
     //---------------Test Result -----------------------
     var bos = typeSource.GetTypes();
     Assert.AreEqual(2, bos.Count());
     bos.ShouldContain(wrapper => wrapper.Name == type1.Name);
     bos.ShouldContain(wrapper => wrapper.Name == type2.Name);
 }
示例#6
0
        public void Test_Add_ShouldReturnAllTypesAdded()
        {
            //---------------Set up test pack-------------------
            CustomTypeSource typeSource = new CustomTypeSource();
            Type             type1      = typeof(FakeExtBoShouldBeLoaded);
            Type             type2      = typeof(FakeExtAbstractBoInterfaceShouldNotBeLoaded);

            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            typeSource.Add(type1);
            typeSource.Add(type2);
            //---------------Test Result -----------------------
            var bos = typeSource.GetTypes();

            Assert.AreEqual(2, bos.Count());
            bos.ShouldContain(wrapper => wrapper.Name == type1.Name);
            bos.ShouldContain(wrapper => wrapper.Name == type2.Name);
        }