| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/autofill_profile_item.h" | 5 #import "ios/chrome/browser/payments/cells/autofill_profile_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 are set properly after a call to |configureCell:|. | 17 // Tests that the labels are set properly after a call to |configureCell:|. |
| 18 TEST(PaymentRequestAutofillProfileItemTest, TextLabels) { | 18 TEST(PaymentRequestAutofillProfileItemTest, TextLabels) { |
| 19 AutofillProfileItem* item = [[AutofillProfileItem alloc] initWithType:0]; | 19 AutofillProfileItem* item = [[AutofillProfileItem alloc] init]; |
| 20 | 20 |
| 21 NSString* name = @"Jon Doe"; | 21 NSString* name = @"Jon Doe"; |
| 22 NSString* address = @"123 Main St, Anytown, USA"; | 22 NSString* address = @"123 Main St, Anytown, USA"; |
| 23 NSString* phoneNumber = @"1234567890"; | 23 NSString* phoneNumber = @"1234567890"; |
| 24 NSString* email = @"123-456-7890"; | 24 NSString* email = @"123-456-7890"; |
| 25 NSString* notification = @"More information is required"; | 25 NSString* notification = @"More information is required"; |
| 26 | 26 |
| 27 item.name = name; | 27 item.name = name; |
| 28 item.address = address; | 28 item.address = address; |
| 29 item.phoneNumber = phoneNumber; | 29 item.phoneNumber = phoneNumber; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 42 | 42 |
| 43 [item configureCell:autofillProfileCell]; | 43 [item configureCell:autofillProfileCell]; |
| 44 EXPECT_NSEQ(name, autofillProfileCell.nameLabel.text); | 44 EXPECT_NSEQ(name, autofillProfileCell.nameLabel.text); |
| 45 EXPECT_NSEQ(address, autofillProfileCell.addressLabel.text); | 45 EXPECT_NSEQ(address, autofillProfileCell.addressLabel.text); |
| 46 EXPECT_NSEQ(phoneNumber, autofillProfileCell.phoneNumberLabel.text); | 46 EXPECT_NSEQ(phoneNumber, autofillProfileCell.phoneNumberLabel.text); |
| 47 EXPECT_NSEQ(email, autofillProfileCell.emailLabel.text); | 47 EXPECT_NSEQ(email, autofillProfileCell.emailLabel.text); |
| 48 EXPECT_NSEQ(notification, autofillProfileCell.notificationLabel.text); | 48 EXPECT_NSEQ(notification, autofillProfileCell.notificationLabel.text); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| OLD | NEW |