コード例 #1
0
    def test_perfect_date_05(self):
        # Setup
        test_name = "Good Date Validator Test #5"
        data_to_test = "1st Jan 2018"
        class_to_test = vdt.ValidateDate()
        expected_result = ["01/01/2018", True]

        # Action & Assert
        self.run_test(expected_result, test_name, class_to_test, data_to_test)
コード例 #2
0
    def test_perfect_date_04(self):
        # Setup
        test_name = "Good Date Validator Test #4"
        data_to_test = " 01.01.1998  #"
        class_to_test = vdt.ValidateDate()
        expected_result = ["01/01/1998", True]

        # Action & Assert
        self.run_test(expected_result, test_name, class_to_test, data_to_test)
コード例 #3
0
    def test_bad_date_06(self):
        # Setup
        test_name = "Bad Date Validator Test #6"
        data_to_test = ""
        class_to_test = vdt.ValidateDate()
        expected_result = ["", False]

        # Action & Assert
        self.run_test(expected_result, test_name, class_to_test, data_to_test)
コード例 #4
0
    def test_bad_date_07(self):
        # Setup
        test_name = "Bad Date Validator Test #7"
        data_to_test = "#*%(#*)#)$#($)#*$*#()*$()#*$#()*$()#" \
                       "*$()#*()*$()#*()#^#%&#@*&*@(*KJFDSJHKAHFKH#$%"
        class_to_test = vdt.ValidateDate()
        expected_result = [
            "#*%(#*)#)$#($)#*$*#()*$()#*$#()*"
            "$()#*$()#*()*$()#*()#^#%&#@*&*@(*"
            "KJFDSJHKAHFKH#$%", False
        ]

        # Action & Assert
        self.run_test(expected_result, test_name, class_to_test, data_to_test)