public void VisitProject_ShouldReturn_Success() { IList <string> whilelist = new List <string>(); var instance = new DisplayStatusVisitor(whilelist); var code = instance.VisitProject(Lib2Directory, Lib2Config); Assert.AreEqual(ReturnCode.Success, code, "Invalid ReturnCode"); Assert.AreEqual(ReturnCode.Success, instance.ReturnCode, "Invalid ReturnCode"); }
public void VisitDependency_ShouldReturn_FailedToRunGitCommand_WhenGitStatusFails() { var git = Container.Resolve <IGit>(); git.Arrange(g => g.Status()) .Returns(ReturnCode.FailedToRunGitCommand); IList <string> whilelist = new List <string>() { Lib1Dependency.Configuration.Name, "OTHER" }; var instance = new DisplayStatusVisitor(whilelist); var code = instance.VisitDependency(Lib2Directory, Lib1Dependency); Assert.AreEqual(ReturnCode.FailedToRunGitCommand, code, "Invalid ReturnCode"); Assert.AreEqual(ReturnCode.FailedToRunGitCommand, instance.ReturnCode, "Invalid ReturnCode"); }
public void VisitDependency_ShouldReturn_Success_WhenWhitelistDoesNotIncludeDependencyName() { var git = Container.Resolve <IGit>(); git.Arrange(g => g.Status()) .OccursNever("git.Status() should not have been called"); IList <string> whilelist = new List <string>() { "No_EXISTE!" }; var instance = new DisplayStatusVisitor(whilelist); var code = instance.VisitDependency(Lib2Directory, Lib1Dependency); Assert.AreEqual(ReturnCode.Success, code, "Invalid ReturnCode"); Assert.AreEqual(ReturnCode.Success, instance.ReturnCode, "Invalid ReturnCode"); }
public void VisitDependency_ShouldReturn_Success_WhenGitStatusSucceeds() { RegisterMockFileSystem(); var git = Container.Resolve <IGit>(); git.Arrange(g => g.Status()) .Returns(() => { Assert.AreEqual(Lib1Directory, git.WorkingDirectory, "Invalid working directory"); return(ReturnCode.Success); }); IList <string> whilelist = new List <string>(); var instance = new DisplayStatusVisitor(whilelist); var code = instance.VisitDependency(Lib2Directory, Lib1Dependency); Assert.AreEqual(ReturnCode.Success, code, "Invalid ReturnCode"); Assert.AreEqual(ReturnCode.Success, instance.ReturnCode, "Invalid ReturnCode"); }