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");
 }
Exemple #3
0
        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()));
        }
Exemple #4
0
        public void OutputToWithBuildArtifact_ShouldOutpt()
        {
            var source = new FluentFs.Core.File("c:\\test.dll");

            _subject.OutputTo(source);
            Assert.That(_subject.Destination, Is.EqualTo(source.ToString()));
        }
Exemple #5
0
        // 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));
        }
Exemple #6
0
        // 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");
        }
Exemple #9
0
        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;
 }
Exemple #15
0
 public MSTestRunner PathToConsoleRunner(File path)
 {
     pathToConsoleRunner = path.ToString();
     return(this);
 }
Exemple #16
0
 public IAssemblyInfoDetails OutputPath(FluentFs.Core.File path)
 {
     return(OutputPath(path.ToString()));
 }
Exemple #17
0
 public void OutputTo(FluentFs.Core.File artifactLocation)
 {
     OutputTo(artifactLocation.ToString());
 }
Exemple #18
0
 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());
 }
Exemple #20
0
 public MSTestRunner ResultsFile(File path)
 {
     return(ResultsFile(path.ToString()));
 }
Exemple #21
0
 public void OutputToWithBuildArtifact_ShouldOutpt()
 {
     var source = new FluentFs.Core.File("c:\\test.dll");
     _subject.OutputTo(source);
     Assert.That(_subject.Destination, Is.EqualTo(source.ToString()));
 }
Exemple #22
0
 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()));
 }
Exemple #23
0
 ///<summary>
 /// Destination
 ///</summary>
 ///<param name="destination">The destination</param>
 public void To(File destination)
 {
     To(destination.ToString());
 }
Exemple #24
0
 internal RenameFile(File file) : this(new FileSystemWrapper(), file)
 {
 }
Exemple #25
0
 ///<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()));
 }
Exemple #26
0
 ///<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)
 {
 }
Exemple #28
0
 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()));
 }
Exemple #30
0
 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()));
 }
Exemple #32
0
 public MSTestRunner WorkingDirectory(File path)
 {
     return(WorkingDirectory(path.ToString()));
 }
Exemple #33
0
 ///<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()));
 }
Exemple #34
0
 public MSTestRunner TestMetadata(File path)
 {
     return(TestMetadata(path.ToString()));
 }
Exemple #35
0
 internal CopyFile(File artifact) : this(new FileSystemWrapper(), artifact)
 {
 }
Exemple #36
0
 public MSTestRunner RunConfig(File path)
 {
     return(RunConfig(path.ToString()));
 }