"""
------------------------------------------------------------------------------
--                                                                          --
--                      FEBRUARY 21 LECTURE EXAMPLES                        --
--                                                                          --
--                       F E B 2 1 _ T E S T S . P Y                        --
--                                                                          --
------------------------------------------------------------------------------
-- Jeremy D Keffer                                                          --
--                                                                          --
-- CISC106 011 Spring 2013                                                  --
--                                                                          --
------------------------------------------------------------------------------
-- This file contains unit tests for the functions we wrote in class on Feb --
-- 21.                                                                      --
--                                                                          --
------------------------------------------------------------------------------
"""

# This is a comment

from feb21 import *
import unittest
import math

class TestFeb21(unittest.TestCase):
    def test_sample(self):
        self.assertEqual(0, 0)
        self.assertAlmostEqual(0, 0.000000000001)
        self.assertTrue(6 == 6)
        self.assertFalse(7 == 6)

    def test_rectangle_area(self):
        self.assertEqual(rectangle_area(1, 1), 1)
        self.assertEqual(rectangle_area(10, 10), 100)
        self.assertEqual(rectangle_area(5, 5), 25)

    def test_distance(self):
        self.assertAlmostEqual(distance(0, 0, 1, 1), math.sqrt(2))
        self.assertAlmostEqual(distance(0, 0, 3, 4), 5)
        self.assertAlmostEqual(distance(0, 0, 5, 0), 5)

    def test_circle_area(self):
        self.assertAlmostEqual(circle_area(1), 3.1415927)
        self.assertAlmostEqual(circle_area(1), math.pi)

    def test_divisible(self):
        self.assertTrue(divisible(18, 6))
        self.assertFalse(divisible(6, 18))
        
if __name__ == '__main__':
    try:
        unittest.main()
    except SystemExit:
        pass
