Example #1
0
            public void Should_Throw_If_Context_Is_Null()
            {
                // Given
                var fixture   = new ScriptProcessorFixture();
                var processor = fixture.CreateProcessor();

                // When
                var result = Record.Exception(() => processor.Process("./build.cake", null));

                // Then
                Assert.IsArgumentNullException(result, "context");
            }
Example #2
0
            public void Should_Throw_If_File_Path_Is_Null()
            {
                // Given
                var fixture   = new ScriptProcessorFixture();
                var processor = fixture.CreateProcessor();

                // When
                var result = Record.Exception(() => processor.Process(null, new ScriptProcessorContext()));

                // Then
                Assert.IsArgumentNullException(result, "path");
            }
Example #3
0
            public void Should_Throw_If_Log_Is_Null()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                fixture.Log = null;

                // When
                var result = Record.Exception(() => fixture.CreateProcessor());

                // Then
                Assert.IsArgumentNullException(result, "log");
            }
Example #4
0
            public void Should_Throw_If_File_System_Is_Null()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                fixture.FileSystem = null;

                // When
                var result = Record.Exception(() => fixture.CreateProcessor());

                // Then
                AssertEx.IsArgumentNullException(result, "fileSystem");
            }
Example #5
0
            public void Should_Throw_If_Context_Is_Null()
            {
                // Given
                var fixture   = new ScriptProcessorFixture();
                var processor = fixture.CreateProcessor();

                // When
                var result = Record.Exception(() => processor.Process("./build.cake", null));

                // Then
                Assert.IsType <ArgumentNullException>(result);
                Assert.Equal("context", ((ArgumentNullException)result).ParamName);
            }
Example #6
0
            public void Should_Throw_If_File_Path_Is_Null()
            {
                // Given
                var fixture   = new ScriptProcessorFixture();
                var processor = fixture.CreateProcessor();

                // When
                var result = Record.Exception(() => processor.Process(null, new ScriptProcessorContext()));

                // Then
                Assert.IsType <ArgumentNullException>(result);
                Assert.Equal("path", ((ArgumentNullException)result).ParamName);
            }
Example #7
0
            public void Should_Throw_If_NuGet_Package_Installer_Is_Null()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                fixture.Installer = null;

                // When
                var result = Record.Exception(() => fixture.CreateProcessor());

                // Then
                Assert.IsArgumentNullException(result, "installer");
            }
Example #8
0
            public void Should_Throw_If_Environment_Is_Null()
            {
                // Given
                var fixture = new ScriptProcessorFixture();

                fixture.Environment = null;

                // When
                var result = Record.Exception(() => fixture.CreateProcessor());

                // Then
                Assert.IsType <ArgumentNullException>(result);
                Assert.Equal("environment", ((ArgumentNullException)result).ParamName);
            }