public VersionReaderFixture()
            {
                var appPath = AppDomain.CurrentDomain.BaseDirectory;

                CakeEnviromentMock
                .Setup(t => t.WorkingDirectory)
                .Returns(new DirectoryPath(appPath));
                CakeContextMock
                .Setup(t => t.ProcessRunner)
                .Returns(ProcessRunner);
                CakeContextMock
                .Setup(t => t.FileSystem)
                .Returns(FileSystem);
                CakeContextMock
                .Setup(t => t.Log)
                .Returns(CakeLog);
                CakeContextMock
                .Setup(t => t.Environment)
                .Returns(CakeEnvironment);
                ProcessRunnerMock
                .Setup(t => t.Start(It.IsAny <FilePath>(), It.IsAny <ProcessSettings>()))
                .Returns(ProcessMock.Object);
                ProcessMock
                .Setup(t => t.GetExitCode())
                .Returns(0);
            }
Пример #2
0
            public CakeOctoDeployAliasFixture(int exitCode)
            {
                GetDirectoryPath = Guid.NewGuid().ToString();

                CakeContextMock.Setup(t => t.ProcessRunner).Returns(ProcessRunnerMock.Object);
                CakeContextMock.Setup(t => t.FileSystem).Returns(FileSysteMock.Object);
                CakeContextMock.Setup(t => t.Log).Returns(GetCakeLog);

                ProcessRunnerMock.Setup(t => t.Start(It.IsAny <FilePath>(), It.IsAny <ProcessSettings>()))
                .Returns(ProcessMock.Object);
                ProcessMock.Setup(t => t.GetExitCode()).Returns(exitCode);
            }