Ejemplo n.º 1
0
                public void Should_Throw_If_Context_Is_Null()
                {
                    // Given, When
                    var result = Record.Exception(() =>
                                                  FileExtensions.DeleteFiles(null, "*"));

                    // Then
                    Assert.IsType <ArgumentNullException>(result);
                    Assert.Equal("context", ((ArgumentNullException)result).ParamName);
                }
Ejemplo n.º 2
0
                public void Should_Delete_Files()
                {
                    // Given
                    var fixture = new FileDeleteFixture();

                    // When
                    FileExtensions.DeleteFiles(fixture.Context, "*");

                    // Then
                    fixture.Files[0].Received(1).Delete();
                    fixture.Files[1].Received(1).Delete();
                }
Ejemplo n.º 3
0
                public void Should_Throw_If_Glob_Expression_Is_Null()
                {
                    // Given
                    var context = Substitute.For <ICakeContext>();

                    // When
                    var result = Record.Exception(() =>
                                                  FileExtensions.DeleteFiles(context, (string)null));

                    // Then
                    Assert.IsType <ArgumentNullException>(result);
                    Assert.Equal("pattern", ((ArgumentNullException)result).ParamName);
                }
Ejemplo n.º 4
0
                public void Should_Throw_If_File_Paths_Are_Null()
                {
                    // Given
                    var context = Substitute.For <ICakeContext>();

                    // When
                    var result = Record.Exception(() =>
                                                  FileExtensions.DeleteFiles(context, (IEnumerable <FilePath>)null));

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