Ticket #1226: Test_dayname.au3

File Test_dayname.au3, 1.7 KB (added by Jimblack, 12 years ago)

Test for _DateDayOfWeek($iDayNum)

Line 
1#include <date.au3>
2;
3Local $iDayNum
4Local $sDayName
5;
6For $iDayNum = 1 to 7
7        $sDayName = _DateDayOfWeek($iDayNum)                                                    ; Name of Day
8        Select
9                case $iDayNum = 1
10                        if $sDayName <> "Sunday" then MsgBox(16, "Test Dayname Error Autoit version " & @AutoItVersion, _
11                                        "Name should be Sunday, it is " & $sDayName & " For Day Number " & $iDayNum)
12                case $iDayNum = 2
13                        if $sDayName <> "Monday" then MsgBox(16, "Test Dayname Error Autoit version " & @AutoItVersion, _
14                                        "Name should be Monday, it is " & $sDayName & " For Day Number " & $iDayNum)
15                case $iDayNum = 3
16                        if $sDayName <> "Tuesday" then MsgBox(16, "Test Dayname Error Autoit version " & @AutoItVersion, _
17                                        "Name should be Tuesday, it is " & $sDayName & " For Day Number " & $iDayNum)
18                case $iDayNum = 4
19                        if $sDayName <> "Wednesday" then MsgBox(16, "Test Dayname Error Autoit version " & @AutoItVersion, _
20                                        "Name should be Wednesday, it is " & $sDayName & " For Day Number " & $iDayNum)
21                case $iDayNum = 5
22                        if $sDayName <> "Thursday" then MsgBox(16, "Test Dayname Error Autoit version " & @AutoItVersion, _
23                                        "Name should be Thursday, it is " & $sDayName & " For Day Number " & $iDayNum)
24                case $iDayNum = 6
25                        if $sDayName <> "Friday" then MsgBox(16, "Test Dayname Error Autoit version " & @AutoItVersion, _
26                                        "Name should be Friday, it is " & $sDayName & " For Day Number " & $iDayNum)
27                case $iDayNum = 7
28                        if $sDayName <> "Saturday" then MsgBox(16, "Test Dayname Error Autoit version " & @AutoItVersion, _
29                                        "Name should be Saturday, it is " & $sDayName & " For Day Number " & $iDayNum)
30                case Else
31                        MsgBox(16, "Test Dayname Error Autoit version " & @AutoItVersion, "DayNum is invalid " & $iDayNum)
32        EndSelect
33Next ;$iDayNum
34;
35exit