public void RetrieveAll_Should_ReturnNoMappedFoldersForTheWorkspace_When_ThereAreNoMappedFoldersForAWorkspace() { const string Workspace1 = "workspace1"; var tfsCommandOutputParser = new Mock<ITfsCommandOutputParser>(); tfsCommandOutputParser.Setup(x => x.ParseWorkspacesOutput(It.IsAny<string>())).Returns(new string[] { Workspace1 }); tfsCommandOutputParser.Setup(x => x.ParseMappedFoldersOutput(It.IsAny<string>())).Returns(new string[0]); var queryService = new TfsWorkspaceQueryService(this.commandFactory.Object, tfsCommandOutputParser.Object); var workspaces = queryService.RetrieveAll().ToList(); Assert.IsFalse(workspaces[0].MappedPaths.Any()); }
public void RetrieveAll_Should_ReturnTheWorkspace_When_ThereIsOneWorkspace() { const string Workspace1 = "workspace1"; var tfsCommandOutputParser = new Mock<ITfsCommandOutputParser>(); tfsCommandOutputParser.Setup(x => x.ParseWorkspacesOutput(It.IsAny<string>())).Returns(new string[] { Workspace1 }); tfsCommandOutputParser.Setup(x => x.ParseMappedFoldersOutput(It.IsAny<string>())).Returns(new string[0]); var queryService = new TfsWorkspaceQueryService(this.commandFactory.Object, tfsCommandOutputParser.Object); var workspaces = queryService.RetrieveAll().ToList(); Assert.IsTrue(workspaces.Count == 1); Assert.IsTrue(workspaces[0].WorkSpaceName == Workspace1); }