utestDate.pas
上传用户:yjb1804
上传日期:2021-01-30
资源大小:3105k
文件大小:1k
- unit utestDate;
- interface
- uses Classes,DateUtils,SysUtils,StrUtils,TestFramework;
- type
- TTestDate=class(TTestCase)
- published
- procedure TestDayOfTheMonth;
- procedure TestDaysInMonth;
- procedure TestDaysInAMonth;
- procedure TestDayInYear;
- procedure TestTimeOf;
- procedure TestDayOf;
- procedure TestMonthOf;
- end;
- implementation
- { TTestDate }
- procedure TTestDate.TestDayInYear;
- begin
- Status('DaysInYear(Now): '+inttostr(DaysInYear(Now)));
- end;
- procedure TTestDate.TestDaysInAMonth;
- begin
- Status('YearOf(Now):'+inttostr(YearOf(Now))+' DaysInAMonth:'+inttostr( DaysInAMonth(YearOf(Now),MonthOf(Now))));
- end;
- procedure TTestDate.TestDaysInMonth;
- begin
- Status('DaysInMonth(Now):'+inttostr(DaysInMonth(Now)));
- end;
- procedure TTestDate.TestDayOfTheMonth;
- begin
- Status('DayOfTheMonth(now):'+inttostr(DayOfTheMonth(now)));
- end;
- procedure TTestDate.TestDayOf;
- begin
- Status('DayOf(Now):'+IntToStr(DayOf(Now)));
- end;
- procedure TTestDate.TestMonthOf;
- begin
- Status('MonthOf(Now):'+IntToStr(MonthOf(Now)));
- end;
- procedure TTestDate.TestTimeOf;
- begin
- Status('TimeOf(Now):'+TimeToStr(TimeOf(Now)));
- end;
- initialization
- TestFramework.RegisterTest(TTestDate.Suite );
- end.