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(); }
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>"); }