Ejemplo n.º 1
0
    def test_build_is_placed_at_the_end_of_the_build_list_when_adding_build(
            self):
        bol = BuildOrderLibrary(self.get_builds())

        bol.add_build(BuildOrder(name="my_added_build"))

        self.assertEqual("my_added_build",
                         bol.get_build_by_index(bol.build_count() - 1).name)
Ejemplo n.º 2
0
    def test_build_is_removed_when_removing_by_build(self):
        blds = self.get_builds()
        bol = BuildOrderLibrary(blds)

        bol.remove_build_by_build_order(blds[1])

        self.assertEqual(2, bol.build_count())
        self.assertIsNone(bol.get_build_by_name("my_second"))
Ejemplo n.º 3
0
    def test_correct_build_count_is_returned(self):
        bol = BuildOrderLibrary(self.get_builds())

        self.assertEqual(3, bol.build_count())
Ejemplo n.º 4
0
    def test_no_builds_are_removed_if_invalid_name_is_given(self):
        bol = BuildOrderLibrary(self.get_builds())

        bol.remove_build_by_name("gggg")

        self.assertEqual(3, bol.build_count())