示例#1
0
        public void Forward_1()
        {
            var behavior = new VSBehavior();

            behavior.Add("filename0", 0, 1);
            behavior.Add("filename1", 0, 1);
            behavior.Add("filename2", 0, 1);
            behavior.Add("filename3", 0, 1);
            behavior.Add("filename4", 0, 1);
            behavior.Backward();
            behavior.Backward();
            Assert.IsTrue(behavior.CurrentItem.Equals("filename2", 0, 1));
            behavior.Forward();
            Assert.IsTrue(behavior.CurrentItem.Equals("filename3", 0, 1));
            behavior.Backward();
            behavior.Backward();
            Assert.IsTrue(behavior.CurrentItem.Equals("filename1", 0, 1));
            behavior.Forward();
            behavior.Forward();
            Assert.IsTrue(behavior.CurrentItem.Equals("filename3", 0, 1));
            behavior.Add("filename5", 0, 1);
            Assert.IsTrue(behavior.CurrentItem.Equals("filename5", 0, 1));
            behavior.Forward();
            behavior.Add("filename5", 0, 1);
        }
示例#2
0
        public void Add()
        {
            var behavior = new VSBehavior();

            behavior.Add("filename", 100, 1);
            Assert.IsTrue(behavior.CurrentItem.Equals("filename", 100, 1));
            behavior.Add("filename", 100, 1);
            Assert.IsTrue(behavior.CurrentItem.Equals("filename", 100, 1));
            behavior.Add("filename", 110, 1);
            Assert.IsTrue(behavior.CurrentItem.Equals("filename", 110, 1));
        }
示例#3
0
        public void Clear()
        {
            var behavior = new VSBehavior();

            behavior.Add("filename", 0, 1);
            behavior.Add("filename", 10, 1);
            behavior.Clear();
            Assert.IsTrue(behavior.CurrentItem.IsEmpty);
            Assert.IsFalse(behavior.CanBackward);
            Assert.IsFalse(behavior.CanForward);
        }
示例#4
0
        public void CanBackward()
        {
            var behavior = new VSBehavior();

            Assert.IsFalse(behavior.CanBackward);
            behavior.Add("filename0", 0, 1);
            behavior.Add("filename1", 0, 1);
            Assert.IsTrue(behavior.CanBackward);
            behavior.Backward();
            Assert.IsFalse(behavior.CanBackward);
        }
示例#5
0
        public void Add_0()
        {
            var behavior = new VSBehavior();

            behavior.Add("filename", 100, 1);
            Assert.IsTrue(behavior.CurrentItem.Equals("filename", 100, 1));
            Assert.IsFalse(behavior.CanBackward);
            behavior.Add("filename", 150, 1);
            Assert.IsTrue(behavior.CurrentItem.Equals("filename", 150, 1));
            Assert.IsTrue(behavior.CanBackward);
            Assert.IsTrue(behavior.GetBackwardItem().Equals("filename", 100, 1));
            behavior.Add("filename", 120, 1);
            Assert.IsTrue(behavior.CurrentItem.Equals("filename", 120, 1));
            Assert.IsTrue(behavior.GetBackwardItem().Equals("filename", 100, 1));
        }
示例#6
0
        public void Change()
        {
            var behavior = new VSBehavior();

            behavior.Add("filename0", 0, 1);
            behavior.Add("filename1", 1, 1);
            behavior.Add("filename0", 100, 2);
            behavior.Add("filename3", 1, 1);
            behavior.Add("filename0", 1000, 3);
            behavior.Change("filename0", 150, 1, 1);
            Assert.IsTrue(behavior.CurrentItem.Equals("filename0", 1001, 4));
            behavior.Change("filename0", 0, 10, 1);
            Assert.IsTrue(behavior.CurrentItem.Equals("filename0", 1011, 5));
            behavior.Backward();
            behavior.Backward();
            Assert.IsTrue(behavior.CurrentItem.Equals("filename0", 110, 3));
            behavior.Backward();
            behavior.Backward();
            Assert.IsTrue(behavior.CurrentItem.Equals("filename0", 10, 2));
        }