From: <sr...@us...> - 2006-12-08 04:18:29
|
Revision: 732 http://svn.sourceforge.net/instantobjects/revision/?rev=732&view=rev Author: srmitch Date: 2006-12-07 20:18:27 -0800 (Thu, 07 Dec 2006) Log Message: ----------- - Missed in previous commit. Modified Paths: -------------- trunk/Tests/TestIO.dpr trunk/Tests/TestInstantDateTime.pas trunk/Tests/TestModel.pas Modified: trunk/Tests/TestIO.dpr =================================================================== --- trunk/Tests/TestIO.dpr 2006-12-03 20:20:14 UTC (rev 731) +++ trunk/Tests/TestIO.dpr 2006-12-08 04:18:27 UTC (rev 732) @@ -38,6 +38,8 @@ TestInstantInteger in 'TestInstantInteger.pas', TestInstantString in 'TestInstantString.pas', TestInstantDateTime in 'TestInstantDateTime.pas', + TestInstantDate in 'TestInstantDate.pas', + TestInstantTime in 'TestInstantTime.pas', TestInstantBoolean in 'TestInstantBoolean.pas', TestInstantFloat in 'TestInstantFloat.pas', TestInstantCurrency in 'TestInstantCurrency.pas', Modified: trunk/Tests/TestInstantDateTime.pas =================================================================== --- trunk/Tests/TestInstantDateTime.pas 2006-12-03 20:20:14 UTC (rev 731) +++ trunk/Tests/TestInstantDateTime.pas 2006-12-08 04:18:27 UTC (rev 732) @@ -49,6 +49,8 @@ procedure TestAsBoolean; procedure TestAsCurrency; procedure TestAsDateTime; + procedure TestAsDate; + procedure TestAsTime; procedure TestAsFloat; procedure TestAsInteger; procedure TestAsObject; @@ -134,6 +136,20 @@ AssertEquals(12.45, FInstantDateTime.AsDateTime); end; +procedure TestTInstantDateTime.TestAsDate; +begin + FInstantDateTime.AsDate := 120.00; + AssertEquals(120.00, FInstantDateTime.Value); + AssertEquals(120.00, FInstantDateTime.AsDate); +end; + +procedure TestTInstantDateTime.TestAsTime; +begin + FInstantDateTime.AsTime := 0.45; + AssertEquals(0.45, FInstantDateTime.Value); + AssertEquals(0.45, FInstantDateTime.AsTime); +end; + procedure TestTInstantDateTime.TestAsFloat; begin try Modified: trunk/Tests/TestModel.pas =================================================================== --- trunk/Tests/TestModel.pas 2006-12-03 20:20:14 UTC (rev 731) +++ trunk/Tests/TestModel.pas 2006-12-08 04:18:27 UTC (rev 732) @@ -237,29 +237,37 @@ Picture: Blob; Salary: Currency; Employed: Boolean; - AL_hours: Float; } + AL_hours: Float; + EmploymentDate: Date; + BirthTime: Time; } _AL_hours: TInstantFloat; _BirthDate: TInstantDateTime; + _BirthTime: TInstantTime; _Emails: TInstantParts; _Employed: TInstantBoolean; _Employer: TInstantReference; + _EmploymentDate: TInstantDate; _Picture: TInstantGraphic; _Salary: TInstantCurrency; private function GetAL_hours: Double; function GetBirthDate: TDateTime; + function GetBirthTime: TDateTime; function GetEmailCount: Integer; function GetEmails(Index: Integer): TEmail; function GetEmployed: Boolean; function GetEmployer: TCompany; + function GetEmploymentDate: TDateTime; function GetMainEmailAddress: string; function GetPicture: string; function GetSalary: Currency; procedure SetAL_hours(Value: Double); procedure SetBirthDate(Value: TDateTime); + procedure SetBirthTime(Value: TDateTime); procedure SetEmails(Index: Integer; Value: TEmail); procedure SetEmployed(Value: Boolean); procedure SetEmployer(const Value: TCompany); + procedure SetEmploymentDate(Value: TDateTime); procedure SetMainEmailAddress(const Value: string); procedure SetPicture(const Value: string); procedure SetSalary(Value: Currency); @@ -278,8 +286,10 @@ published property AL_hours: Double read GetAL_hours write SetAL_hours; property BirthDate: TDateTime read GetBirthDate write SetBirthDate; + property BirthTime: TDateTime read GetBirthTime write SetBirthTime; property Employed: Boolean read GetEmployed write SetEmployed; property Employer: TCompany read GetEmployer write SetEmployer; + property EmploymentDate: TDateTime read GetEmploymentDate write SetEmploymentDate; property MainEmailAddress: string read GetMainEmailAddress write SetMainEmailAddress; property Picture: string read GetPicture write SetPicture; property Salary: Currency read GetSalary write SetSalary; @@ -705,6 +715,11 @@ Result := _BirthDate.Value; end; +function TPerson.GetBirthTime: TDateTime; +begin + Result := _BirthTime.Value; +end; + function TPerson.GetEmailCount: Integer; begin Result := _Emails.Count @@ -725,6 +740,11 @@ Result := _Employer.Value as TCompany; end; +function TPerson.GetEmploymentDate: TDateTime; +begin + Result := _EmploymentDate.Value; +end; + function TPerson.GetMainEmailAddress: string; begin if EmailCount > 0 then @@ -768,6 +788,11 @@ _BirthDate.Value := Value; end; +procedure TPerson.SetBirthTime(Value: TDateTime); +begin + _BirthTime.Value := Value; +end; + procedure TPerson.SetEmails(Index: Integer; Value: TEmail); begin _Emails[Index] := Value; @@ -783,6 +808,11 @@ _Employer.Value := Value; end; +procedure TPerson.SetEmploymentDate(Value: TDateTime); +begin + _EmploymentDate.Value := Value; +end; + procedure TPerson.SetMainEmailAddress(const Value: string); var Email: TEmail; |