public void GetStatusWillRunForProvidedProject() { MockGitLocationForConfiguration(); Command command = MockCommandProperties(); Runner runner = MockRunner(); Mocks.ReplayAll(); runner.Output = "# On branch "; var status = new Status { ProjectLocation = GitTestProjectLocation, CommandArguments = command, Runner = runner, EnvironmentVariable = StubEnvironmentVariable() }; status.Run(); Assert.That(status.Output, Contains.Substring("# On branch ")); Assert.That(runner.Command, Is.EqualTo(command)); Assert.That(command.CommandFullLocation, Is.EqualTo(GitInstallLocation)); Assert.That(command.Arguments, Is.EqualTo("status")); Assert.That(command.WorkingDirectory, Is.EqualTo(GitTestProjectLocation)); }
private EnvironmentVariable SetUpForEnvironmentTests(out Status status) { MockGitLocationForConfiguration(); Command command = MockCommandProperties(); Runner runner = MockRunner(); var environmentVariable = Mocks.StrictMock<EnvironmentVariable>(); environmentVariable.SetPropertyAsBehavior(v => v.Home); environmentVariable.SetPropertyAsBehavior(v => v.HomeDrive); environmentVariable.SetPropertyAsBehavior(v => v.HomePath); environmentVariable.SetPropertyAsBehavior(v => v.UserProfile); Mocks.ReplayAll(); status = new Status { ProjectLocation = GitTestProjectLocation, CommandArguments = command, Runner = runner, EnvironmentVariable = environmentVariable }; return environmentVariable; }