@@ -11,38 +11,38 @@ public class PurchaseManagerTest extends AndroidTestCase {
11
11
protected void tearDown () throws Exception {
12
12
super .tearDown ();
13
13
BillingDB mData = new BillingDB (getContext ());
14
- mData .mDb .delete (BillingDB .TABLE_PURCHASES , null , null );
14
+ mData .mDb .delete (BillingDB .TABLE_TRANSACTIONS , null , null );
15
15
mData .close ();
16
16
}
17
17
18
18
@ MediumTest
19
19
public void testAddPurchase () throws Exception {
20
- PurchaseManager . addPurchase (getContext (), PurchaseTest .PURCHASE_1 );
21
- final List <Purchase > purchases = PurchaseManager . getPurchases (getContext ());
20
+ TransactionManager . addTransaction (getContext (), TransactionTest .PURCHASE_1 );
21
+ final List <Transaction > purchases = TransactionManager . getTransactions (getContext ());
22
22
assertEquals (purchases .size (), 1 );
23
- final Purchase stored = purchases .get (0 );
24
- BillingDBTest .assertEqualsFromDb (PurchaseTest .PURCHASE_1 , stored );
23
+ final Transaction stored = purchases .get (0 );
24
+ BillingDBTest .assertEqualsFromDb (TransactionTest .PURCHASE_1 , stored );
25
25
}
26
26
27
- public static Purchase clone (Purchase p ) {
28
- return new Purchase (p .orderId , p .productId , p .packageName , p .purchaseState , p .notificationId , p .purchaseTime , p .developerPayload );
27
+ public static Transaction clone (Transaction p ) {
28
+ return new Transaction (p .orderId , p .productId , p .packageName , p .purchaseState , p .notificationId , p .purchaseTime , p .developerPayload );
29
29
}
30
30
31
31
@ MediumTest
32
32
public void testCountPurchases () throws Exception {
33
- assertEquals (PurchaseManager .countPurchases (getContext (), PurchaseTest .PURCHASE_1 .productId ), 0 );
34
- PurchaseManager . addPurchase (getContext (), PurchaseTest .PURCHASE_1 );
35
- assertEquals (PurchaseManager .countPurchases (getContext (), PurchaseTest .PURCHASE_1 .productId ), 1 );
36
- final Purchase newOrder = clone (PurchaseTest .PURCHASE_1 );
33
+ assertEquals (TransactionManager .countPurchases (getContext (), TransactionTest .PURCHASE_1 .productId ), 0 );
34
+ TransactionManager . addTransaction (getContext (), TransactionTest .PURCHASE_1 );
35
+ assertEquals (TransactionManager .countPurchases (getContext (), TransactionTest .PURCHASE_1 .productId ), 1 );
36
+ final Transaction newOrder = clone (TransactionTest .PURCHASE_1 );
37
37
newOrder .orderId = "newOrder" ;
38
- PurchaseManager . addPurchase (getContext (), newOrder );
39
- assertEquals (PurchaseManager .countPurchases (getContext (), PurchaseTest .PURCHASE_1 .productId ), 2 );
38
+ TransactionManager . addTransaction (getContext (), newOrder );
39
+ assertEquals (TransactionManager .countPurchases (getContext (), TransactionTest .PURCHASE_1 .productId ), 2 );
40
40
}
41
41
42
42
@ MediumTest
43
43
public void testIsPurchased () throws Exception {
44
- assertFalse (PurchaseManager .isPurchased (getContext (), PurchaseTest .PURCHASE_1 .productId ));
45
- PurchaseManager . addPurchase (getContext (), PurchaseTest .PURCHASE_1 );
46
- assertTrue (PurchaseManager .isPurchased (getContext (), PurchaseTest .PURCHASE_1 .productId ));
44
+ assertFalse (TransactionManager .isPurchased (getContext (), TransactionTest .PURCHASE_1 .productId ));
45
+ TransactionManager . addTransaction (getContext (), TransactionTest .PURCHASE_1 );
46
+ assertTrue (TransactionManager .isPurchased (getContext (), TransactionTest .PURCHASE_1 .productId ));
47
47
}
48
48
}
0 commit comments