public void IsSourceControlBoundReturnsTrueIfInWorkspace() { var root = Path.GetTempPath(); var path = Path.GetRandomFileName(); var workspace = new Mock <ITfsWorkspace>(); workspace.Setup(w => w.ItemExists(It.IsAny <string>())) .Returns(true); var target = new TfsFileSystem(workspace.Object, root); bool result = target.IsSourceControlBound(path); workspace.Verify(w => w.ItemExists(Path.Combine(root, path)), Times.Once()); Assert.True(result, "File was incorrectly determined to not be source control bound."); }
public void IsSourceControlBoundReturnsTrueIfInWorkspace() { var root = Path.GetTempPath(); var path = Path.GetRandomFileName(); var workspace = new Mock<ITfsWorkspace>(); workspace.Setup(w => w.ItemExists(It.IsAny<string>())) .Returns(true); var target = new TfsFileSystem(workspace.Object, root); bool result = target.IsSourceControlBound(path); workspace.Verify(w => w.ItemExists(Path.Combine(root, path)), Times.Once()); Assert.True(result, "File was incorrectly determined to not be source control bound."); }