public void SutIsCatalog()
 {
     // Fixture setup
     var dummyCatalog = new AggregateCatalog();
     // Exercise system
     var sut = new SauceCatalog(dummyCatalog);
     // Verify outcome
     Assert.IsAssignableFrom<ComposablePartCatalog>(sut);
     // Teardown
 }
        public void SutIsCatalog()
        {
            // Fixture setup
            var dummyCatalog = new AggregateCatalog();
            // Exercise system
            var sut = new SauceCatalog(dummyCatalog);

            // Verify outcome
            Assert.IsAssignableFrom <ComposablePartCatalog>(sut);
            // Teardown
        }
예제 #3
0
        public void ResolveSaucesBySauceCatalog()
        {
            var representative    = typeof(Ploeh.Samples.Menu.Mef.Attributed.Unmodified.Abstract.SauceBéarnaise);
            var ingredientCatalog = new AssemblyCatalog(representative.Assembly);
            var catalog           = new SauceCatalog(ingredientCatalog);
            var container         = new CompositionContainer(catalog);

            var sauces = container.GetExportedValues <IIngredient>();

            Assert.True(sauces.OfType <SauceBéarnaise>().Any());
            Assert.True(sauces.OfType <SauceHollandaise>().Any());
            Assert.True(sauces.OfType <SauceMousseline>().Any());

            Assert.False(sauces.OfType <Steak>().Any());
        }
예제 #4
0
        public void ResolveSaucesBySauceCatalog()
        {
            var representative = typeof(Ploeh.Samples.Menu.Mef.Attributed.Unmodified.Abstract.SauceBéarnaise);
            var ingredientCatalog = new AssemblyCatalog(representative.Assembly);
            var catalog = new SauceCatalog(ingredientCatalog);
            var container = new CompositionContainer(catalog);

            var sauces = container.GetExportedValues<IIngredient>();

            Assert.True(sauces.OfType<SauceBéarnaise>().Any());
            Assert.True(sauces.OfType<SauceHollandaise>().Any());
            Assert.True(sauces.OfType<SauceMousseline>().Any());

            Assert.False(sauces.OfType<Steak>().Any());
        }