public void Should_Move_File() { // Given var fixture = new FileCopyFixture(); // When FileAliases.MoveFileToDirectory(fixture.Context, "./file1.txt", "./target"); // Then fixture.TargetFiles[0].Received(1).Move( Arg.Is <FilePath>(p => p.FullPath == "/Working/target/file1.txt")); }
public void Should_Throw_If_Context_Is_Null() { // Given, When var source = new FilePath("./source.txt"); var target = new DirectoryPath("./target"); var result = Record.Exception(() => FileAliases.MoveFileToDirectory(null, source, target)); // Then Assert.IsArgumentNullException(result, "context"); }
public void Should_Throw_If_Target_File_Path_Is_Null() { // Given var context = Substitute.For <ICakeContext>(); var source = new FilePath("./source.txt"); // When var result = Record.Exception(() => FileAliases.MoveFileToDirectory(context, source, null)); // Then Assert.IsArgumentNullException(result, "targetDirectoryPath"); }
public void Should_Throw_If_Source_File_Path_Is_Null() { // Given var context = Substitute.For <ICakeContext>(); var target = new DirectoryPath("./target"); // When var result = Record.Exception(() => FileAliases.MoveFileToDirectory(context, null, target)); // Then AssertEx.IsArgumentNullException(result, "filePath"); }