예제 #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
 void NavigateForward(object sender, EventArgs e)
 {
     if (!behavior.CanForward)
     {
         return;
     }
     behavior.Forward();
     Navigate(behavior.CurrentItem);
 }
예제 #3
0
        public void CanForward()
        {
            var behavior = new VSBehavior();

            Assert.IsFalse(behavior.CanForward);
            behavior.Add("filename0", 0, 1);
            behavior.Add("filename1", 0, 1);
            Assert.IsFalse(behavior.CanForward);
            behavior.Backward();
            Assert.IsTrue(behavior.CanForward);
            behavior.Forward();
            Assert.IsFalse(behavior.CanForward);
            behavior.Backward();
            behavior.Add("filename3", 0, 1);
            Assert.IsFalse(behavior.CanForward);
        }