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); }
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); }
void NavigateBackward(object sender, EventArgs e) { if (!behavior.CanBackward) { return; } behavior.Backward(); Navigate(behavior.CurrentItem); }
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)); }