コード例 #1
0
        public void RemoveAtPath()
        {
            State.RemoveAtPath(TestPath);

            Assert.AreEqual(1, State.ChangeList.Count);

            // the local state should have the same item marked as deleted
            Assert.AreEqual(1, State.Current.Count);
            Assert.IsTrue(State.Current[TestPath].IsDeleted);
        }
コード例 #2
0
        public void AddAtPath_RemoveAtPath()
        {
            // add new item to the local state
            State.AddAtPath("/test", CreateMetadata("/test"));
            // then remove the added item
            State.RemoveAtPath("/test");

            // this should not have any changes pending
            Assert.AreEqual(0, State.ChangeList.Count);

            // the local state should keep deleted item marked accordingly
            Assert.AreEqual(1, State.Current.Count);
            Assert.IsTrue(State.Current["/test"].IsDeleted);
        }
コード例 #3
0
        public void RemoveParentFolder()
        {
            State.RemoveAtPath(TestFolderPath);

            // this should yield pending change for each file in the folder
            Assert.AreEqual(2, State.ChangeList.Count);

            // the local state should keep all items, with 2 of them marked as deleted
            Assert.AreEqual(_files.Count, State.Current.Count);

            Assert.AreEqual(2, State.Current.Values.Count(f => f.IsDeleted));
        }