Пример #1
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.CheckIfFileIsInRepository(filePath, settings));

                // Then
                result.IsArgumentOutOfRangeException("filePath");
            }
Пример #2
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.CheckIfFileIsInRepository(filePath, settings));

                // Then
                result.IsArgumentNullException("repositorySettings");
            }
Пример #3
0
            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.CheckIfFileIsInRepository(filePath, settings));

                // Then
                result.IsArgumentNullException("filePath");
            }
Пример #4
0
            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);
            }