Пример #1
0
        public void GetSystemFilePathTest()
        {
            WebServerResources webServerResources = new WebServerResources(Mock.Of <IScriptList>());

            webServerResources.GetSystemFilePath("").Should().BeNull();
            webServerResources.GetSystemFilePath("file2.js").Should().BeNull();
            webServerResources.GetSystemFilePath("file1.js").Should().BeNull();
            webServerResources.GetSystemFilePath("folder1/file2.js").Should().BeNull();
        }
Пример #2
0
        public void RunnerScriptsInject()
        {
            Mock <IScriptList> servedScriptListMock = new Mock <IScriptList>();

            servedScriptListMock.Setup(sl => sl.Scripts).Returns(new string[] { "Scripts/jasmine.js", "Client/ReporterAdapters/jasmineAdapter.js", "Client/testScript.js" });

            string responseContent = new WebServerResources(servedScriptListMock.Object).GetContent("~internal~/Client/runner.html");

            responseContent.Should().Contain("<script src=\"/Scripts/jasmine.js\"></script>");
            responseContent.Should().Contain("<script src=\"/Client/ReporterAdapters/jasmineAdapter.js\"></script>");
            responseContent.Should().Contain("<script src=\"/Client/testScript.js\"></script>");
        }