public void Create_DoesNotSupportViewComponentTagHelpers_ForVersion1_0()
        {
            // Arrange
            var snapshot = Snapshot_For_1_0;

            var factory = new DefaultProjectSnapshotProjectEngineFactory(FallbackFactory, CustomFactories);

            // Act
            var engine = factory.Create(snapshot, b => b.Features.Add(new MyCoolNewFeature()));

            // Assert
            Assert.Single(engine.Engine.Features.OfType <MyCoolNewFeature>());
            Assert.Single(engine.Engine.Features.OfType <Mvc1_X.MvcViewDocumentClassifierPass>());

            Assert.Empty(engine.Engine.Features.OfType <MvcLatest.ViewComponentTagHelperDescriptorProvider>());
            Assert.Empty(engine.Engine.Features.OfType <MvcLatest.MvcViewDocumentClassifierPass>());
            Assert.Empty(engine.Engine.Features.OfType <MvcLatest.ViewComponentTagHelperPass>());

            Assert.Empty(engine.Engine.Features.OfType <Mvc2_X.ViewComponentTagHelperDescriptorProvider>());
            Assert.Empty(engine.Engine.Features.OfType <Mvc2_X.MvcViewDocumentClassifierPass>());
            Assert.Empty(engine.Engine.Features.OfType <Mvc2_X.ViewComponentTagHelperPass>());

            Assert.Empty(engine.Engine.Features.OfType <Mvc1_X.ViewComponentTagHelperDescriptorProvider>());
            Assert.Empty(engine.Engine.Features.OfType <Mvc1_X.ViewComponentTagHelperPass>());
        }
        public void Create_ForUnknownConfiguration_UsesFallbackFactory()
        {
            var snapshot = Snapshot_For_UnknownConfiguration;

            var factory = new DefaultProjectSnapshotProjectEngineFactory(FallbackFactory, CustomFactories);

            // Act
            var engine = factory.Create(snapshot, b => b.Features.Add(new MyCoolNewFeature()));

            // Assert
            Assert.Single(engine.Engine.Features.OfType <MyCoolNewFeature>());
            Assert.Empty(engine.Engine.Features.OfType <DefaultTagHelperDescriptorProvider>());
            Assert.Empty(engine.Engine.Features.OfType <MvcLatest.ViewComponentTagHelperDescriptorProvider>());
            Assert.Empty(engine.Engine.Features.OfType <MvcLatest.MvcViewDocumentClassifierPass>());
            Assert.Empty(engine.Engine.Features.OfType <MvcLatest.ViewComponentTagHelperPass>());
        }
Example #3
0
        public void Create_CreatesDesignTimeTemplateEngine_ForVersion2_0()
        {
            // Arrange
            var snapshot = Snapshot_For_2_0;

            var factory = new DefaultProjectSnapshotProjectEngineFactory(FallbackFactory, CustomFactories);

            // Act
            var engine = factory.Create(snapshot, b =>
            {
                b.Features.Add(new MyCoolNewFeature());
            });

            // Assert
            Assert.Single(engine.Engine.Features.OfType <MyCoolNewFeature>());
            Assert.Single(engine.Engine.Features.OfType <MvcLatest.ViewComponentTagHelperDescriptorProvider>());
            Assert.Single(engine.Engine.Features.OfType <MvcLatest.MvcViewDocumentClassifierPass>());
            Assert.Single(engine.Engine.Features.OfType <MvcLatest.ViewComponentTagHelperPass>());
        }