Exemplo n.º 1
0
        public void LoadFeaturesByTypes_Returns_Instances_Of_Specified_Types()
        {
            var featureTypes         = new[] { typeof(AspNetMvcFeature), typeof(AspNetWebApiFeature) };
            var features             = FeatureLoader.LoadFeaturesByTypes(featureTypes);
            var returnedFeatureTypes = features.Select(f => f.GetType());

            Assert.True(features.Count() == 2);
            CollectionAssert.Contains(returnedFeatureTypes, typeof(AspNetMvcFeature));
            CollectionAssert.Contains(returnedFeatureTypes, typeof(AspNetWebApiFeature));
        }
Exemplo n.º 2
0
        public void LoadFeaturesByTypes_Returns_An_Empty_Collection_When_Parameters_Are_Invalid()
        {
            var invalidTypes = new List <Type>
            {
                typeof(StringBuilder),
                typeof(Array)
            };
            var loadedFeatures = FeatureLoader.LoadFeaturesByTypes(invalidTypes);

            CollectionAssert.IsEmpty(loadedFeatures);
        }