public void GetTypes_WillReturnEmptyCollection_WhenAssemblyWithNoTypesInsidedSpecified()
        {
            var typesExtractor = new Fake_GuiTypesExtractor();

            var types = typesExtractor.GetGuiTypesOnly(new AssemblyWrapper());

            Assert.AreEqual(0, types.Count);
        }
        public void GetTypes_WillReturnSingleType_WhenOnlyUserControlTypePresentInAssembly()
        {
            var typesExtractor = new Fake_GuiTypesExtractor();
            typesExtractor.ForcedAllTypesInsideAssembly.Add(typeof(UserControl));

            var types = typesExtractor.GetGuiTypesOnly(new AssemblyWrapper());

            Assert.AreEqual(1, types.Count);
        }
        public void GetTypes_WillReturnCustomType_WhenCustomTypeDerivedFromWindow()
        {
            var typesExtractor = new Fake_GuiTypesExtractor();
            typesExtractor.ForcedAllTypesInsideAssembly.Add(typeof(SubTypeOfWindow));

            var types = typesExtractor.GetGuiTypesOnly(new AssemblyWrapper());

            Assert.AreEqual(1, types.Count);
        }
        public void GetTypes_WillReturnEmptyCollection_WhenOnlyNonGuiTypesInsideAssembly()
        {
            var typesExtractor = new Fake_GuiTypesExtractor();
            typesExtractor.ForcedAllTypesInsideAssembly.Add(typeof(System.IO.Stream));
            typesExtractor.ForcedAllTypesInsideAssembly.Add(typeof(System.Net.Sockets.Socket));
            typesExtractor.ForcedAllTypesInsideAssembly.Add(typeof(ResourceDictionary));

            var types = typesExtractor.GetGuiTypesOnly(new AssemblyWrapper());

            Assert.AreEqual(0, types.Count);
        }
        public void GetTypes_WillFilterOutNonGuiTypes_WhenBothGuiAndNonGuiTypesInsideAssembly()
        {
            var typesExtractor = new Fake_GuiTypesExtractor();
            typesExtractor.ForcedAllTypesInsideAssembly.Add(typeof(Window));
            typesExtractor.ForcedAllTypesInsideAssembly.Add(typeof(Page));
            typesExtractor.ForcedAllTypesInsideAssembly.Add(typeof(System.IO.Stream));
            typesExtractor.ForcedAllTypesInsideAssembly.Add(typeof(System.Net.Sockets.Socket));
            typesExtractor.ForcedAllTypesInsideAssembly.Add(typeof(ResourceDictionary));

            var types = typesExtractor.GetGuiTypesOnly(new AssemblyWrapper());

            Assert.AreEqual(2, types.Count);
        }