class TestExampleService(unittest.TestCase):
    def setUp(self):
        self.exampleService = ExampleService(None)

    def test_getGreetingMessage_WithNameAdam_ReturnsStringWithNameAdam(self):
        expected = "Hello Adam. Greetings to you!"
        actual = self.exampleService.getGreetingMessage(name="Adam")

        self.assertEqual(expected, actual,
                         "The expected string did not come back")

    def test_getTwoPlusTwo_Returns4(self):
        expected = 4
        actual = self.exampleService.getTwoPlusTwo()

        self.assertEqual(expected, actual, "Expected 2 + 2 to equal 4")
Exemplo n.º 2
0
class TestExampleService(unittest.TestCase):
	def setUp(self):
		self.exampleService = ExampleService(None)


	def test_getGreetingMessage_WithNameAdam_ReturnsStringWithNameAdam(self):
		expected = "Hello Adam. Greetings to you!"
		actual = self.exampleService.getGreetingMessage(name = "Adam")

		self.assertEqual(expected, actual, "The expected string did not come back")

	def test_getTwoPlusTwo_Returns4(self):
		expected = 4
		actual = self.exampleService.getTwoPlusTwo()

		self.assertEqual(expected, actual, "Expected 2 + 2 to equal 4")
		
Exemplo n.º 3
0
 def getExampleService(self):
     return self._getService(ExampleService(self.db), [])
Exemplo n.º 4
0
	def setUp(self):
		self.exampleService = ExampleService(None)
 def setUp(self):
     self.exampleService = ExampleService(None)