Пример #1
0
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var format   = new FakeMsBuildLogFileFormat(new FakeLog());
                var filePath = @"c:\repo\foo.ch";
                RepositorySettings settings = null;

                // When
                var result = Record.Exception(() => format.MakeFilePathRelativeToRepositoryRoot(filePath, settings));

                // Then
                result.IsArgumentNullException("repositorySettings");
            }
Пример #2
0
            public void Should_Throw_If_FilePath_Is_WhiteSpace()
            {
                // Given
                var format   = new FakeMsBuildLogFileFormat(new FakeLog());
                var filePath = " ";
                var settings = new RepositorySettings(@"c:\repo");

                // When
                var result = Record.Exception(() => format.MakeFilePathRelativeToRepositoryRoot(filePath, settings));

                // Then
                result.IsArgumentOutOfRangeException("filePath");
            }
Пример #3
0
            public void Should_Make_FilePath_Relative_To_Repository_Root(
                string filePath,
                string repoRoot,
                string expectedValue)
            {
                // Given
                var format   = new FakeMsBuildLogFileFormat(new FakeLog());
                var settings = new RepositorySettings(repoRoot);

                // When
                var result = format.MakeFilePathRelativeToRepositoryRoot(filePath, settings);

                // Then
                result.ShouldBe(expectedValue);
            }