Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #import "ios/chrome/browser/ui/suggestions/suggestions_expandable_item.h" | |
| 6 | |
| 7 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | |
| 9 | |
| 10 namespace { | |
| 11 | |
| 12 TEST(SuggestionsExpandableItemTest, CellIsConfigured) { | |
| 13 NSString* title = @"testTitle"; | |
| 14 NSString* subtitle = @"testSubtitle"; | |
| 15 UIImage* image = [[UIImage alloc] init]; | |
| 16 NSString* details = @"testDetails"; | |
| 17 SuggestionsExpandableItem* item = | |
| 18 [[SuggestionsExpandableItem alloc] initWithType:0 | |
| 19 title:title | |
| 20 subtitle:subtitle | |
| 21 image:image | |
| 22 detailText:details]; | |
| 23 SuggestionsExpandableCell* cell = [[[item cellClass] alloc] init]; | |
| 24 EXPECT_TRUE([cell isMemberOfClass:[SuggestionsExpandableCell class]]); | |
| 25 | |
| 26 [item configureCell:cell]; | |
| 27 EXPECT_EQ(title, cell.titleLabel.text); | |
| 28 EXPECT_EQ(subtitle, cell.subtitleLabel.text); | |
| 29 EXPECT_EQ(image, cell.imageView.image); | |
| 30 EXPECT_EQ(details, cell.detailLabel.text); | |
| 31 } | |
| 32 | |
|
lpromero
2017/01/13 17:35:48
Can you add a test for the delegate and the expans
gambard
2017/01/16 09:50:39
Done.
| |
| 33 } // namespace | |
| OLD | NEW |