예제 #1
0
 public void SetUp()
 {
     _mockExecutable = MockRepository.GenerateStub <IExecutable>();
     _subject        = new MSTestRunner(_mockExecutable);
     _dummyData      = "testData";
     _dummyFile      = new FluentFs.Core.File("dummy");
 }
예제 #2
0
 public void SetUp()
 {
     _mockExecutable = MockRepository.GenerateStub<IExecutable>();
     _subject = new MSTestRunner(_mockExecutable);
     _dummyData = "testData";
     _dummyFile = new FluentFs.Core.File("dummy");
 }
예제 #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()));
        }
예제 #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()));
        }
예제 #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));
        }
예제 #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")));
        }
예제 #7
0
        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");
        }
예제 #8
0
        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");
        }
예제 #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?"));
        }
예제 #10
0
        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));
        }
예제 #11
0
        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));
        }
예제 #12
0
        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));
        }
예제 #13
0
        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));
        }
예제 #14
0
 internal MoveFileArtifact(IFileSystemWrapper fileSystemWrapper, File file)
 {
     _fileSystemWrapper = fileSystemWrapper;
     _file = file;
 }
예제 #15
0
 public MSTestRunner PathToConsoleRunner(File path)
 {
     pathToConsoleRunner = path.ToString();
     return(this);
 }
예제 #16
0
 public IAssemblyInfoDetails OutputPath(FluentFs.Core.File path)
 {
     return(OutputPath(path.ToString()));
 }
예제 #17
0
 public void OutputTo(FluentFs.Core.File artifactLocation)
 {
     OutputTo(artifactLocation.ToString());
 }
예제 #18
0
 public MSTestRunner TestContainer(File path)
 {
     return(TestContainer(path.ToString()));
 }
예제 #19
0
 ///<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());
 }
예제 #20
0
 public MSTestRunner ResultsFile(File path)
 {
     return(ResultsFile(path.ToString()));
 }
예제 #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()));
 }
예제 #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()));
 }
예제 #23
0
 ///<summary>
 /// Destination
 ///</summary>
 ///<param name="destination">The destination</param>
 public void To(File destination)
 {
     To(destination.ToString());
 }
예제 #24
0
 internal RenameFile(File file) : this(new FileSystemWrapper(), file)
 {
 }
예제 #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()));
 }
예제 #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()));
 }
예제 #27
0
 internal MoveFileArtifact(File file)
     : this(new FileSystemWrapper(), file)
 {
 }
예제 #28
0
 public void Setup()
 {
     _artifact = new File(rootFolder + "\\test.txt");
     System.IO.File.Create(_artifact.ToString()).Dispose();
 }
예제 #29
0
 ///<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()));
 }
예제 #30
0
 internal RenameFile(IFileSystemWrapper fileSystemWrapper, File file)
 {
     _fileSystemWrapper = fileSystemWrapper;
     _file = file;
 }
예제 #31
0
 ///<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()));
 }
예제 #32
0
 public MSTestRunner WorkingDirectory(File path)
 {
     return(WorkingDirectory(path.ToString()));
 }
예제 #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()));
 }
예제 #34
0
 public MSTestRunner TestMetadata(File path)
 {
     return(TestMetadata(path.ToString()));
 }
예제 #35
0
 internal CopyFile(File artifact) : this(new FileSystemWrapper(), artifact)
 {
 }
예제 #36
0
 public MSTestRunner RunConfig(File path)
 {
     return(RunConfig(path.ToString()));
 }