public void Should_Remove_Leading_Directory_Separator(string filePath, string expectedValue) { // Given var format = new FakeMsBuildLogFileFormat(new FakeLog()); // When var result = format.RemoveLeadingDirectorySeparator(filePath); // Then result.ShouldBe(expectedValue); }
public void Should_Throw_If_FilePath_Is_WhiteSpace() { // Given var format = new FakeMsBuildLogFileFormat(new FakeLog()); var filePath = " "; // When var result = Record.Exception(() => format.RemoveLeadingDirectorySeparator(filePath)); // Then result.IsArgumentOutOfRangeException("filePath"); }
public void Should_Throw_If_FilePath_Is_Null() { // Given var format = new FakeMsBuildLogFileFormat(new FakeLog()); string filePath = null; // When var result = Record.Exception(() => format.RemoveLeadingDirectorySeparator(filePath)); // Then result.IsArgumentNullException("filePath"); }
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.ValidateFilePath(filePath, settings)); // Then result.IsArgumentNullException("repositorySettings"); }
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.ValidateFilePath(filePath, settings)); // Then result.IsArgumentOutOfRangeException("filePath"); }
public void Should_Throw_If_FilePath_Is_Empty() { // Given var format = new FakeMsBuildLogFileFormat(new FakeLog()); var filePath = string.Empty; var settings = new RepositorySettings(@"c:\repo"); // When var result = Record.Exception(() => format.MakeFilePathRelativeToRepositoryRoot(filePath, settings)); // Then result.IsArgumentOutOfRangeException("filePath"); }
public void Should_Throw_If_FilePath_Is_Null() { // Given var format = new FakeMsBuildLogFileFormat(new FakeLog()); string filePath = null; var settings = new RepositorySettings(@"c:\repo"); // When var result = Record.Exception(() => format.ValidateFilePath(filePath, settings)); // Then result.IsArgumentNullException("filePath"); }
public void Should_Return_Correct_Value_For_FilePath( string filePath, string repoRoot, string expectedValue) { // Given var format = new FakeMsBuildLogFileFormat(new FakeLog()); var settings = new RepositorySettings(repoRoot); // When var result = format.ValidateFilePath(filePath, settings); // Then result.FilePath.ShouldBe(expectedValue); }
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); }
public void Should_Check_If_File_Is_In_Repository( string filePath, string repoRoot, bool expectedValue) { // Given var format = new FakeMsBuildLogFileFormat(new FakeLog()); var settings = new RepositorySettings(repoRoot); // When var result = format.CheckIfFileIsInRepository(filePath, settings); // Then result.ShouldBe(expectedValue); }