public void TestOnlyMeta()
        {
            UnityPendingChangesTree tree = new UnityPendingChangesTree();

            WorkspaceInfo wkInfo = new WorkspaceInfo("foo", "/foo");

            PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges =
                new PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges(wkInfo);

            ChangeInfo addedMeta = new ChangeInfo()
            {
                Path = "/foo/foo.c.meta",
            };

            pendingChanges.Added.Add(addedMeta);

            tree.BuildChangeCategories(
                wkInfo.ClientPath,
                pendingChanges,
                new PlasticGui.WorkspaceWindow.PendingChanges.CheckedStateManager());

            Assert.IsNull(
                tree.GetMetaChange(addedMeta),
                "Meta change should be null");
        }
        public void TestMovedNoMeta()
        {
            UnityPendingChangesTree tree = new UnityPendingChangesTree();

            WorkspaceInfo wkInfo = new WorkspaceInfo("foo", "/foo");

            PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges =
                new PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges(wkInfo);

            ChangeInfo moved = new ChangeInfo()
            {
                OldPath = "/foo/foo.c",
                Path    = "/foo/bar/newfoo.c",
            };

            pendingChanges.Moved.Add(moved);

            tree.BuildChangeCategories(
                wkInfo.ClientPath,
                pendingChanges,
                new PlasticGui.WorkspaceWindow.PendingChanges.CheckedStateManager());

            Assert.IsNull(
                tree.GetMetaChange(moved),
                "Meta change should be null");
        }
        public void TestMovedWithMeta()
        {
            UnityPendingChangesTree tree = new UnityPendingChangesTree();

            WorkspaceInfo wkInfo = new WorkspaceInfo("foo", "/foo");

            PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges =
                new PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges(wkInfo);

            ChangeInfo moved = new ChangeInfo()
            {
                OldPath = "/foo/foo.c",
                Path    = "/foo/bar/newfoo.c",
            };

            ChangeInfo movedMeta = new ChangeInfo()
            {
                OldPath = "/foo/foo.c.meta",
                Path    = "/foo/bar/newfoo.c.meta",
            };

            pendingChanges.Moved.Add(moved);
            pendingChanges.Moved.Add(movedMeta);

            tree.BuildChangeCategories(
                wkInfo.ClientPath,
                pendingChanges,
                new PlasticGui.WorkspaceWindow.PendingChanges.CheckedStateManager());

            Assert.IsTrue(
                pendingChanges.Moved.Contains(moved),
                "Pending changes should contain the change");

            Assert.IsFalse(
                pendingChanges.Moved.Contains(movedMeta),
                "Pending changes should not contain the meta");

            Assert.AreEqual(movedMeta, tree.GetMetaChange(moved));
        }