public void Execute_ShouldReturn_InvalidArguments_WhenNoBranchNameIsPresent() { var options = new CheckOutSubOptions(); var instance = new CheckOutCommand(options); var code = instance.Execute(); Assert.AreEqual(ReturnCode.InvalidArguments, code, "Invalid Return Code"); }
public void Execute_ShouldReturn_Error_WhenTraverseDependencies_Fails() { const string BRANCH_NAME = "feature/testing_2"; var algorithm = Container.Resolve <IDependencyVisitorAlgorithm>(); algorithm.Arrange(a => a.TraverseDependencies(Arg.IsAny <IVisitor>(), Arg.AnyString)) .DoInstead((IVisitor visitor, string directory) => { visitor.ReturnCode = ReturnCode.FailedToRunGitCommand; }) .MustBeCalled(); var options = new CheckOutSubOptions { BranchName = BRANCH_NAME }; var instance = new CheckOutCommand(options); var code = instance.Execute(); algorithm.Assert(); Assert.AreEqual(ReturnCode.FailedToRunGitCommand, code, "Invalid Return Code"); }