예제 #1
0
 def test_should_not_decrement_offset_if_going_back_one_position(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = 3
     cursor.position = 2
     self.assertEqual(1, cursor.offset)
예제 #2
0
 def test_should_decrement_position_past_beginning_of_screen(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = -1
     self.assertEqual(-1, cursor.offset)
예제 #3
0
 def test_should_increment_offset_if_position_was_offscreen(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = -1
     cursor.position = 0
     self.assertEqual(0, cursor.offset)
예제 #4
0
 def test_should_increment_position_with_smaller_count(self):
     cursor = ScreenCursor(count=2, visible_count=5)
     cursor.position = 1
     self.assertEqual(0, cursor.offset)
     self.assertEqual(1, cursor.position)
예제 #5
0
 def test_should_increment_position_past_end_of_screen(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = 5
     self.assertEqual(3, cursor.offset)
예제 #6
0
 def test_should_increment_position(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = 1
     self.assertEqual(0, cursor.offset)
     self.assertEqual(1, cursor.position)
예제 #7
0
 def test_should_increment_position(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = 1
     self.assertEqual(0, cursor.offset)
     self.assertEqual(1, cursor.position)
예제 #8
0
 def test_should_create_cursor(self):
     cursor = ScreenCursor(count=5)
     self.assertEqual(5, cursor.visible_count)
     self.assertEqual(0, cursor.offset)
     self.assertEqual(0, cursor.position)
예제 #9
0
 def test_should_decrement_offset_if_count_and_visible_count_increase(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = 4
     cursor.count = 6
     cursor.visible_count = 4
     self.assertEqual(2, cursor.offset)
예제 #10
0
 def test_should_increment_offset_if_position_was_offscreen(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = -1
     cursor.position = 0
     self.assertEqual(0, cursor.offset)
예제 #11
0
 def test_should_not_decrement_offset_if_going_back_one_position(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = 3
     cursor.position = 2
     self.assertEqual(1, cursor.offset)
예제 #12
0
 def test_should_decrement_position_past_beginning_of_screen(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = -1
     self.assertEqual(-1, cursor.offset)
예제 #13
0
 def test_should_increment_position_past_end_of_screen(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = 5
     self.assertEqual(3, cursor.offset)
예제 #14
0
 def test_should_increment_position_with_smaller_count(self):
     cursor = ScreenCursor(count=2, visible_count=5)
     cursor.position = 1
     self.assertEqual(0, cursor.offset)
     self.assertEqual(1, cursor.position)
예제 #15
0
 def test_should_decrement_offset_if_count_and_visible_count_increase(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = 4
     cursor.count = 6
     cursor.visible_count = 4
     self.assertEqual(2, cursor.offset)
예제 #16
0
 def test_should_decrement_offset_if_position_would_be_offscreen(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = 4
     cursor.position = 1
     self.assertEqual(1, cursor.offset)
예제 #17
0
 def test_should_decrement_offset_if_position_would_be_offscreen(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     cursor.position = 4
     cursor.position = 1
     self.assertEqual(1, cursor.offset)
예제 #18
0
 def test_should_create_cursor_with_smaller_visible_count(self):
     cursor = ScreenCursor(count=5, visible_count=3)
     self.assertEqual(3, cursor.visible_count)