コード例 #1
0
    def test_set_when_more_than_one_element_in_myarray(self):
        # Arrange
        myarray = MyArray('i', 100, 200)

        # Act
        myarray.set(1, 300)

        # Assert
        self.assertEqual(300, myarray.get(1))
コード例 #2
0
    def test_set_when_single_element_in_myarray(self):
        # Arrange
        myarray = MyArray('i', 100)

        # Act
        myarray.set(0, 200)

        # Assert
        self.assertEqual(200, myarray.get(0))