示例#1
0
            public void Should_Return_Single_Path_For_Relative_Directory_Path_Without_Glob_Pattern()
            {
                // Given
                var fixture = new GlobberFixture();

                fixture.SetWorkingDirectory("/Working/Foo");

                // When
                var result = fixture.Match("./Bar");

                // Then
                Assert.Equal(1, result.Length);
                Assert.ContainsDirectoryPath(result, "/Working/Foo/Bar");
            }
示例#2
0
            public void Should_Return_Single_Path_For_Relative_File_Path_Without_Glob_Pattern()
            {
                // Given
                var fixture = new GlobberFixture();

                fixture.SetWorkingDirectory("/Working/Foo");

                // When
                var result = fixture.Match("./Bar/Qux.c");

                // Then
                Assert.Single(result);
                AssertEx.ContainsFilePath(result, "/Working/Foo/Bar/Qux.c");
            }
示例#3
0
            public void Will_Fix_Root_If_Drive_Is_Missing_By_Using_The_Drive_From_The_Working_Directory()
            {
                // Given
                var fixture = new GlobberFixture();

                fixture.SetWorkingDirectory("C:/Working/");
                var globber = fixture.CreateGlobber();

                // When
                var result = globber.Match("/Temp/Hello/World/Text.txt").ToArray();

                // Then
                Assert.Equal(1, result.Length);
                Assert.Equal("C:/Temp/Hello/World/Text.txt", result[0].FullPath);
            }
示例#4
0
            public void Should_Return_Single_Path_For_Relative_Directory_Path_Without_Glob_Pattern()
            {
                // Given
                var fixture = new GlobberFixture();

                fixture.SetWorkingDirectory("/Temp/Hello");
                var globber = fixture.CreateGlobber();

                // When
                var result = globber.Match("./World").ToArray();

                // Then
                Assert.Equal(1, result.Length);
                Assert.IsType <DirectoryPath>(result[0]);
                Assert.Equal("/Temp/Hello/World", result[0].FullPath);
            }