OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/chrome/browser/payments/cells/payment_method_item.h" | 5 #import "ios/chrome/browser/payments/cells/payment_method_item.h" |
6 | 6 |
7 #import "ios/chrome/browser/ui/collection_view/cells/test_utils.h" | 7 #import "ios/chrome/browser/ui/collection_view/cells/test_utils.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "testing/gtest_mac.h" | 9 #include "testing/gtest_mac.h" |
10 | 10 |
11 #if !defined(__has_feature) || !__has_feature(objc_arc) | 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
12 #error "This file requires ARC support." | 12 #error "This file requires ARC support." |
13 #endif | 13 #endif |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // Tests that the labels and image are set properly after a call to | 17 // Tests that the labels and image are set properly after a call to |
18 // |configureCell:|. | 18 // |configureCell:|. |
19 TEST(PaymentRequestPaymentMethodItemTest, TextLabels) { | 19 TEST(PaymentRequestPaymentMethodItemTest, TextLabels) { |
20 PaymentMethodItem* item = [[PaymentMethodItem alloc] initWithType:0]; | 20 PaymentMethodItem* item = [[PaymentMethodItem alloc] init]; |
21 | 21 |
22 NSString* methodID = @"BobPay - ****-6789"; | 22 NSString* methodID = @"BobPay - ****-6789"; |
23 NSString* methodDetail = @"Bobs Your Uncle III, esq."; | 23 NSString* methodDetail = @"Bobs Your Uncle III, esq."; |
24 NSString* methodAddress = @"123 Bob St, Halifax, NS"; | 24 NSString* methodAddress = @"123 Bob St, Halifax, NS"; |
25 NSString* notification = @"More information is required."; | 25 NSString* notification = @"More information is required."; |
26 UIImage* methodTypeIcon = ios_internal::CollectionViewTestImage(); | 26 UIImage* methodTypeIcon = ios_internal::CollectionViewTestImage(); |
27 MDCCollectionViewCellAccessoryType accessoryType = | 27 MDCCollectionViewCellAccessoryType accessoryType = |
28 MDCCollectionViewCellAccessoryDisclosureIndicator; | 28 MDCCollectionViewCellAccessoryDisclosureIndicator; |
29 | 29 |
30 item.methodID = methodID; | 30 item.methodID = methodID; |
(...skipping 19 matching lines...) Expand all Loading... |
50 EXPECT_NSEQ(methodID, paymentMethodCell.methodIDLabel.text); | 50 EXPECT_NSEQ(methodID, paymentMethodCell.methodIDLabel.text); |
51 EXPECT_NSEQ(methodDetail, paymentMethodCell.methodDetailLabel.text); | 51 EXPECT_NSEQ(methodDetail, paymentMethodCell.methodDetailLabel.text); |
52 EXPECT_NSEQ(methodAddress, paymentMethodCell.methodAddressLabel.text); | 52 EXPECT_NSEQ(methodAddress, paymentMethodCell.methodAddressLabel.text); |
53 EXPECT_NSEQ(notification, paymentMethodCell.notificationLabel.text); | 53 EXPECT_NSEQ(notification, paymentMethodCell.notificationLabel.text); |
54 EXPECT_NSEQ(methodTypeIcon, paymentMethodCell.methodTypeIconView.image); | 54 EXPECT_NSEQ(methodTypeIcon, paymentMethodCell.methodTypeIconView.image); |
55 EXPECT_EQ(paymentMethodCell.accessoryType, | 55 EXPECT_EQ(paymentMethodCell.accessoryType, |
56 MDCCollectionViewCellAccessoryDisclosureIndicator); | 56 MDCCollectionViewCellAccessoryDisclosureIndicator); |
57 } | 57 } |
58 | 58 |
59 } // namespace | 59 } // namespace |
OLD | NEW |