"""
------------------------------------------------------------------------------
--                                                                          --
--                        MARCH 21 LECTURE EXAMPLES                         --
--                                                                          --
--                      M A R C H 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     --
-- March 21.                                                                --
--                                                                          --
------------------------------------------------------------------------------
"""

from march21 import *
import unittest
import math

class TestMarch21(unittest.TestCase):
    def test_square_list(self):
        self.assertEqual(square_list([1, 2, 3, 4, 5]), [1, 4, 9, 16, 25])

    def test_only_even(self):
        self.assertEqual(only_even([1, 2, 3, 4, 5, 6]), [2, 4, 6])

    def test_maybe_inner_product(self):
        self.assertEqual(maybe_inner_product([2, 4, 6]), 48)

    def test_dot_product(self):
        self.assertEqual(dot_product([1, 2, 3], [4, 5, 6]), [4, 10, 18])
    
if __name__ == '__main__':
    try:
        unittest.main()
    except SystemExit:
        pass
