Lid |
|
Hallo,
Ik ben bezig met een vooropgestelde code waarbij verschillende methods extra zouden moeten geschreven worden én de uitkomst natuurlijk True van is. Vooropgestelde code is(én mag niet veranderd worden):
Module DatumsOproepen
Sub Main()
Console.WriteLine(GetDayOfYear(2011, 1, 1) = 1) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2011, 1, 2) = 2) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2011, 1, 31) = 31) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2011, 2, 1) = 32) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2011, 3, 1) = 60) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2011, 5, 8) = 128) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2011, 10, 13) = 286) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2011, 12, 31) = 365) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2012, 3, 1) = 61) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2012, 5, 8) = 129) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2012, 10, 13) = 287) ' Assertion should be True.
Console.WriteLine(GetDayOfYear(2012, 12, 31) = 366) ' Assertion should be True.
'
Console.WriteLine(GetDaysInYear(1900) = 365) ' Assertion should be True.
Console.WriteLine(GetDaysInYear(1901) = 365) ' Assertion should be True.
Console.WriteLine(GetDaysInYear(1904) = 366) ' Assertion should be True.
Console.WriteLine(GetDaysInYear(1996) = 366) ' Assertion should be True.
Console.WriteLine(GetDaysInYear(1999) = 365) ' Assertion should be True.
Console.WriteLine(GetDaysInYear(2000) = 366) ' Assertion should be True.
Console.WriteLine(GetDaysInYear(2001) = 365) ' Assertion should be True.
Console.WriteLine(GetDaysInYear(2004) = 366) ' Assertion should be True.
'
Console.WriteLine(GetDayOfWeek(1, 1, 1) = "Monday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(1, 1, 2) = "Tuesday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(1, 1, 3) = "Wednesday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(1, 1, 4) = "Thursday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(1, 1, 5) = "Friday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(1, 1, 6) = "Saturday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(1, 1, 7) = "Sunday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(1, 1, 8) = "Monday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(2, 1, 1) = "Tuesday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(3, 1, 1) = "Wednesday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(4, 1, 1) = "Thursday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(5, 1, 1) = "Saturday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(2011, 11, 11) = "Friday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(2011, 11, 27) = "Sunday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(2011, 11, 28) = "Monday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(2012, 1, 1) = "Sunday") ' Assertion should be True.
Console.WriteLine(GetDayOfWeek(2012, 3, 1) = "Thursday") ' Assertion should be True.
'
Console.WriteLine(IsOnSunday(1, 1, 7)) ' Assertion should be True.
Console.WriteLine(IsOnSunday(2011, 11, 27)) ' Assertion should be True.
Console.WriteLine(IsOnSunday(2012, 1, 1)) ' Assertion should be True.
Console.WriteLine(Not IsOnSunday(1, 1, 1)) ' Assertion should be True.
Console.WriteLine(Not IsOnSunday(2011, 11, 11)) ' Assertion should be True.
Console.WriteLine(Not IsOnSunday(2011, 11, 28)) ' Assertion should be True.
Console.ReadLine()
End Sub
End Module
Module DatumsOproepen Sub Main() Console.WriteLine(GetDayOfYear(2011, 1, 1) = 1) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2011, 1, 2) = 2) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2011, 1, 31) = 31) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2011, 2, 1) = 32) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2011, 3, 1) = 60) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2011, 5, 8) = 128) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2011, 10, 13) = 286) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2011, 12, 31) = 365) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2012, 3, 1) = 61) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2012, 5, 8) = 129) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2012, 10, 13) = 287) ' Assertion should be True. Console.WriteLine(GetDayOfYear(2012, 12, 31) = 366) ' Assertion should be True. ' Console.WriteLine(GetDaysInYear(1900) = 365) ' Assertion should be True. Console.WriteLine(GetDaysInYear(1901) = 365) ' Assertion should be True. Console.WriteLine(GetDaysInYear(1904) = 366) ' Assertion should be True. Console.WriteLine(GetDaysInYear(1996) = 366) ' Assertion should be True. Console.WriteLine(GetDaysInYear(1999) = 365) ' Assertion should be True. Console.WriteLine(GetDaysInYear(2000) = 366) ' Assertion should be True. Console.WriteLine(GetDaysInYear(2001) = 365) ' Assertion should be True. Console.WriteLine(GetDaysInYear(2004) = 366) ' Assertion should be True. ' Console.WriteLine(GetDayOfWeek(1, 1, 1) = "Monday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(1, 1, 2) = "Tuesday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(1, 1, 3) = "Wednesday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(1, 1, 4) = "Thursday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(1, 1, 5) = "Friday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(1, 1, 6) = "Saturday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(1, 1, 7) = "Sunday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(1, 1, 8) = "Monday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(2, 1, 1) = "Tuesday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(3, 1, 1) = "Wednesday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(4, 1, 1) = "Thursday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(5, 1, 1) = "Saturday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(2011, 11, 11) = "Friday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(2011, 11, 27) = "Sunday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(2011, 11, 28) = "Monday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(2012, 1, 1) = "Sunday") ' Assertion should be True. Console.WriteLine(GetDayOfWeek(2012, 3, 1) = "Thursday") ' Assertion should be True. ' Console.WriteLine(IsOnSunday(1, 1, 7)) ' Assertion should be True. Console.WriteLine(IsOnSunday(2011, 11, 27)) ' Assertion should be True. Console.WriteLine(IsOnSunday(2012, 1, 1)) ' Assertion should be True. Console.WriteLine(Not IsOnSunday(1, 1, 1)) ' Assertion should be True. Console.WriteLine(Not IsOnSunday(2011, 11, 11)) ' Assertion should be True. Console.WriteLine(Not IsOnSunday(2011, 11, 28)) ' Assertion should be True. Console.ReadLine() End Sub End Module
Kan er iemand voor dit enige methodes schrijven?
Bedankt!
|