コード例 #1
0
        public void ShouldNotUpdateGroupIdsAfterUnlockingGroup()
        {
            ILockGroupManager manager = this.CreateGroupLockManager();

            var element1 = new TimelineElement();
            var element2 = new TimelineElement();
            var element3 = new TimelineElement();
            var element4 = new TimelineElement();

            var group1 = new List <TimelineElement> {
                element1, element2
            };
            var group2 = new List <TimelineElement> {
                element3, element4
            };

            manager.LockElements(group1);
            manager.LockElements(group2);

            Assert.AreEqual(1, manager.LockGroups.Last().Id);

            manager.UnlockElementLockGroup(element2);

            Assert.AreEqual(1, manager.LockGroups.Count);

            Assert.AreEqual(1, manager.LockGroups.Last().Id);
        }
コード例 #2
0
        public void ShouldProvideLowestAvailableGroupIdWhenGroupingNewElements()
        {
            ILockGroupManager manager = this.CreateGroupLockManager();

            var element1 = new TimelineElement();
            var element2 = new TimelineElement();
            var element3 = new TimelineElement();
            var element4 = new TimelineElement();
            var element5 = new TimelineElement();
            var element6 = new TimelineElement();
            var element7 = new TimelineElement();
            var element8 = new TimelineElement();

            var group1 = new List <TimelineElement> {
                element1, element2
            };
            var group2 = new List <TimelineElement> {
                element3, element4
            };
            var group3 = new List <TimelineElement> {
                element5, element6
            };
            var group4 = new List <TimelineElement> {
                element7, element8
            };

            manager.LockElements(group1);
            manager.LockElements(group2);
            manager.LockElements(group3);

            manager.UnlockElementLockGroup(element1);

            manager.LockElements(group4);

            Assert.AreEqual(0, manager.LockGroups.Last().Id);
        }
コード例 #3
0
        public void ShouldReturnSingleElementAfterUnlockingGroup()
        {
            ILockGroupManager manager = this.CreateGroupLockManager();

            var element1 = new TimelineElement();
            var element2 = new TimelineElement();

            var group1 = new List <TimelineElement> {
                element1, element2
            };

            manager.LockElements(group1);

            manager.UnlockElementLockGroup(element2);

            Assert.AreEqual(0, manager.LockGroups.Count);

            var elements = manager.GetGroupedElements(element1);

            Assert.AreEqual(1, elements.Count());

            elements = manager.GetGroupedElements(element2);
            Assert.AreEqual(1, elements.Count());
        }