Пример #1
0
            public async Task SuccessfulRouteTests(string vpath, string path, string pathInfo)
            {
                // Arrange
                TestableDefaultRouter router       = CreateRouter();
                IFileInfo             expectedFile = router.TestFileSystem.AddTestFile(path);

                // Act
                RouteResult routed = await router.Route(
                    TestData.CreateRequest(path: vpath),
                    NullTrace.Instance);

                // Assert
                Assert.True(routed.Success);
                Assert.Equal(pathInfo, routed.PathInfo);
                Assert.Equal(expectedFile, routed.File);
            }
Пример #2
0
            public async Task ReturnsFailedResultIfNoFileMatchesVirtualPath()
            {
                // Arrange
                TestableDefaultRouter router       = CreateRouter();
                IFileInfo             expectedFile = router.TestFileSystem.AddTestFile(@"Does\Not\Match");

                // Act
                RouteResult routed = await router.Route(
                    TestData.CreateRequest(path: "Does/This/Match"),
                    NullTrace.Instance);

                // Assert
                Assert.False(routed.Success);
                Assert.Null(routed.PathInfo);
                Assert.Null(routed.File);
            }