コード例 #1
0
ファイル: TfsFileSystemTest.cs プロジェクト: hu19891110/NuGet
        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.");
        }
コード例 #2
0
        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.");
        }