Esempio n. 1
0
        public void RenderStylesheets_Development()
        {
            var mock = new Mock <IWebHostEnvironment>();

            mock.Setup(m => m.EnvironmentName).Returns("Development");
            ServiceProvider.AddSingleton(provider => mock.Object);

            var context = new DefaultHttpContext();

            context.AddStylesheet("main");

            var rendered = context.RenderStylesheets();

            var expected = new HtmlString("<script src=\"stylesheet:main\"></script>\n");

            Assert.AreEqual(expected.Value, rendered.Value);
        }
Esempio n. 2
0
        public void RenderStylesheets_Production()
        {
            var mock = new Mock <IWebHostEnvironment>();

            mock.Setup(m => m.EnvironmentName).Returns("Production");
            ServiceProvider.AddSingleton(provider => mock.Object);

            var context = new DefaultHttpContext();

            context.AddStylesheet("main");

            var rendered = context.RenderStylesheets();

            var expected = new HtmlString("<link rel=\"stylesheet\" href=\"stylesheet:main\"/>\n");

            Assert.AreEqual(expected.Value, rendered.Value);
        }