public void SetUp() { _mockExecutable = MockRepository.GenerateStub <IExecutable>(); _subject = new MSTestRunner(_mockExecutable); _dummyData = "testData"; _dummyFile = new FluentFs.Core.File("dummy"); }
public void SetUp() { _mockExecutable = MockRepository.GenerateStub<IExecutable>(); _subject = new MSTestRunner(_mockExecutable); _dummyData = "testData"; _dummyFile = new FluentFs.Core.File("dummy"); }
public void AddBuildArtifactSource_ShouldSetSource() { var source = new FluentFs.Core.File("c:\\test.dll"); _subject.AddSource(source); Assert.That(_subject.Sources[0], Is.EqualTo(source.ToString())); }
public void OutputToWithBuildArtifact_ShouldOutpt() { var source = new FluentFs.Core.File("c:\\test.dll"); _subject.OutputTo(source); Assert.That(_subject.Destination, Is.EqualTo(source.ToString())); }
// c:\temp\test.txt --> c:\temp\test2.txt public void ReplaceToken_Should_Copy_To_New_File() { var artifact = new FluentFs.Core.File(Path.Combine(rootFolder, "test.txt")); string destination = Path.Combine(rootFolder, "test2.txt"); artifact.Copy.To(destination); Assert.That(File.Exists(destination)); }
// c:\temp\test.txt --> c:\temp\dir1 public void ReplaceToken_Should_Copy_To_New_Directory_And_Perserve_File_Name() { var artifact = new FluentFs.Core.File(Path.Combine(rootFolder, "test.txt")); string destination = Path.Combine(rootFolder, "dir1"); artifact.Copy.To(destination); Assert.That(File.Exists(Path.Combine(destination, "test.txt"))); }
public void ShouldFailOnError() { var buildArtifact = new File("c:\\nonexistant.txt"); var fileSystemWrapper = MockRepository.GenerateStub<IFileSystemWrapper>(); var subject = new RenameFile(fileSystemWrapper, buildArtifact); fileSystemWrapper.Stub(x => x.MoveFile("", "")).IgnoreArguments().Throw(new IOException("Could not do that")); subject.FailOnError.To("nonexistant2.txt"); }
public void ShouildContinueOnError() { var buildArtifact = new File("c:\\nonexistant.txt"); var fileSystemWrapper = MockRepository.GenerateMock <IFileSystemWrapper>(); var subject = new RenameFile(fileSystemWrapper, buildArtifact); fileSystemWrapper.Stub(x => x.MoveFile("", "")).IgnoreArguments().Throw(new IOException("Could not do that")); subject.ContinueOnError.To("nonexistant2.txt"); }
public void ReplaceToken() { var artifact = new FluentFs.Core.File(Path.Combine(rootFolder, "test.txt")); string destination = Path.Combine(rootFolder, "test2.txt"); artifact.Copy.ReplaceToken("LastName").With("Smith").ReplaceToken("FirstName").With("John").To(destination); Assert.That(File.Exists(destination)); string[] strings = File.ReadAllLines(destination); Assert.That(strings[0], Is.EqualTo("Hello Smith, John. How are you?")); }
public void ShouldCallWrapperMoveFile() { string origin = "c:\\nonexistant.txt"; string destination = "nonexistant2.txt"; var buildArtifact = new File(origin); var fileSystemWrapper = MockRepository.GenerateMock <IFileSystemWrapper>(); var subject = new RenameFile(fileSystemWrapper, buildArtifact); subject.To(destination); fileSystemWrapper.AssertWasCalled(x => x.MoveFile(origin, "c:\\\\" + destination)); }
public void ShouldCallWrapperMoveFile() { string origin = "c:\\nonexistant.txt"; string destination = "nonexistant2.txt"; var buildArtifact = new File(origin); var fileSystemWrapper = MockRepository.GenerateMock<IFileSystemWrapper>(); var subject = new RenameFile(fileSystemWrapper, buildArtifact); subject.To(destination); fileSystemWrapper.AssertWasCalled(x=>x.MoveFile(origin, "c:\\\\" + destination)); }
public void PathShouldBeChangedAfterRename() { string origin = "c:\\nonexistant.txt"; string destination = "nonexistant2.txt"; var buildArtifact = new File(origin); var fileSystemWrapper = MockRepository.GenerateMock<IFileSystemWrapper>(); var subject = new RenameFile(fileSystemWrapper, buildArtifact); var destinationWithFolder = @"c:\\" + destination; fileSystemWrapper.Stub(x => x.MoveFile(origin, destinationWithFolder)); subject.To(destination); Assert.That(buildArtifact.ToString(), Is.EqualTo(destinationWithFolder)); }
public void PathShouldBeChangedAfterRename() { string origin = "c:\\nonexistant.txt"; string destination = "nonexistant2.txt"; var buildArtifact = new File(origin); var fileSystemWrapper = MockRepository.GenerateMock <IFileSystemWrapper>(); var subject = new RenameFile(fileSystemWrapper, buildArtifact); var destinationWithFolder = @"c:\\" + destination; fileSystemWrapper.Stub(x => x.MoveFile(origin, destinationWithFolder)); subject.To(destination); Assert.That(buildArtifact.ToString(), Is.EqualTo(destinationWithFolder)); }
internal MoveFileArtifact(IFileSystemWrapper fileSystemWrapper, File file) { _fileSystemWrapper = fileSystemWrapper; _file = file; }
public MSTestRunner PathToConsoleRunner(File path) { pathToConsoleRunner = path.ToString(); return(this); }
public IAssemblyInfoDetails OutputPath(FluentFs.Core.File path) { return(OutputPath(path.ToString())); }
public void OutputTo(FluentFs.Core.File artifactLocation) { OutputTo(artifactLocation.ToString()); }
public MSTestRunner TestContainer(File path) { return(TestContainer(path.ToString())); }
///<summary> /// The location to place the output ///</summary> ///<param name="zipFilePath">path to the output file</param> public void To(FluentFs.Core.File zipFilePath) { To(zipFilePath.ToString()); }
public MSTestRunner ResultsFile(File path) { return(ResultsFile(path.ToString())); }
///<summary> /// Destination ///</summary> ///<param name="destination">The destination</param> public void To(File destination) { To(destination.ToString()); }
internal RenameFile(File file) : this(new FileSystemWrapper(), file) { }
///<summary> /// Adds a source file to merge in ///</summary> ///<param name="source">path to the file to merge in</param> public ILMerge AddSource(FluentFs.Core.File source) { return(AddSource(source.ToString())); }
///<summary> /// Sets the output location ///</summary> ///<param name="destination">path to output file</param> public ILMerge OutputTo(FluentFs.Core.File destination) { return(OutputTo(destination.ToString())); }
internal MoveFileArtifact(File file) : this(new FileSystemWrapper(), file) { }
public void Setup() { _artifact = new File(rootFolder + "\\test.txt"); System.IO.File.Create(_artifact.ToString()).Dispose(); }
///<summary> /// Moves a file to a destination ///</summary> ///<param name="destination">the new location of the file</param> public File To(File destination) { return(To(destination.ToString())); }
internal RenameFile(IFileSystemWrapper fileSystemWrapper, File file) { _fileSystemWrapper = fileSystemWrapper; _file = file; }
///<summary> /// Sets ZipCompress to compress a single file ///</summary> ///<param name="file">The file to compress</param> public ZipCompress SourceFile(FluentFs.Core.File file) { return(SourceFile(file.ToString())); }
public MSTestRunner WorkingDirectory(File path) { return(WorkingDirectory(path.ToString())); }
///<summary> /// The assembly to run nunit against ///</summary> ///<param name="File">build artifact that represents the path to the assembly to test</param> ///<returns></returns> public NUnitRunner FileToTest(FluentFs.Core.File buildArtifact) { return(FileToTest(buildArtifact.ToString())); }
public MSTestRunner TestMetadata(File path) { return(TestMetadata(path.ToString())); }
internal CopyFile(File artifact) : this(new FileSystemWrapper(), artifact) { }
public MSTestRunner RunConfig(File path) { return(RunConfig(path.ToString())); }