Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: ios/chrome/browser/ui/payments/cells/payments_selector_edit_item_unittests.mm

Issue 2879433002: [Payment Request] PaymentsSelectorEditItem (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/payments/cells/payments_selector_edit_item_unittests.mm
diff --git a/ios/chrome/browser/ui/payments/cells/payments_selector_edit_item_unittests.mm b/ios/chrome/browser/ui/payments/cells/payments_selector_edit_item_unittests.mm
new file mode 100644
index 0000000000000000000000000000000000000000..5b25b2a73bddf386cdc93d2829661e92e8bf2bbd
--- /dev/null
+++ b/ios/chrome/browser/ui/payments/cells/payments_selector_edit_item_unittests.mm
@@ -0,0 +1,39 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/payments/cells/payments_selector_edit_item.h"
+
+#import "ios/chrome/browser/ui/collection_view/cells/collection_view_detail_item.h"
+#import "ios/chrome/browser/ui/collection_view/cells/test_utils.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/gtest_mac.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+namespace {
+
+// Tests that the UILabels are set properly after a call to |configureCell:|.
+TEST(PaymentRequestPaymentsSelectorEditItemTest, TextLabels) {
+ PaymentsSelectorEditItem* item = [[PaymentsSelectorEditItem alloc] init];
+ NSString* name = @"Name text";
+ NSString* value = @"Value text";
+
+ item.name = name;
+ item.value = value;
+
+ id cell = [[[item cellClass] alloc] init];
+ ASSERT_TRUE([cell isMemberOfClass:[CollectionViewDetailCell class]]);
+
+ CollectionViewDetailCell* detailCell = cell;
+ EXPECT_FALSE(detailCell.textLabel.text);
+ EXPECT_FALSE(detailCell.detailTextLabel.text);
+
+ [item configureCell:cell];
+ EXPECT_NSEQ(name, detailCell.textLabel.text);
macourteau 2017/05/10 19:51:16 Maybe add a check that required fields have a "*"
Moe 2017/05/11 14:17:18 Done.
+ EXPECT_NSEQ(value, detailCell.detailTextLabel.text);
+}
+
+} // namespace

Powered by Google App Engine
This is Rietveld 408576698