-
-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathDelphiAIDev.Test.ContextDemo.pas
More file actions
48 lines (38 loc) · 1.38 KB
/
DelphiAIDev.Test.ContextDemo.pas
File metadata and controls
48 lines (38 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
unit DelphiAIDev.Test.ContextDemo;
interface
uses
System.SysUtils;
type
// Classe de exemplo para testar o Contexto Global da IA
TShoppingCartItem = class
private
FItemName: string;
FQuantity: Integer;
FPrice: Currency;
FDiscount: Currency;
FTotal: Currency;
procedure SetTotal(const Value: Currency);
public
// A IA deve ser capaz de ler estas propriedades na interface
// mesmo que o cursor esteja lá embaixo na implementação.
property ItemName: string read FItemName write FItemName;
property Quantity: Integer read FQuantity write FQuantity;
property Price: Currency read FPrice write FPrice;
property Discount: Currency read FDiscount write FDiscount;
property Total: Currency read FTotal write SetTotal;
// Descomente a linha abaixo antes do teste, parao Delphi não reclamar..
// procedure CalculateFinalPrice;
end;
implementation
{ TShoppingCartItem }
procedure TShoppingCartItem.SetTotal(const Value: Currency);
begin
FTotal := Value;
end;
// -----------------------------------------------------------------------------
// CASO DE TESTE:
// Posicione o cursor na linha abaixo e acione o Code Completion (Alt+Enter padrão)
// Tente algo como: "Implemente o metodo CalculateFinalPrice considerando desconto"
// -----------------------------------------------------------------------------
// << PONTO DE TESTE AQUI >>
end.