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_article_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(SuggestionsArticleItemTest, CellIsConfigured) { |
| 13 NSString* title = @"testTitle"; |
| 14 NSString* subtitle = @"testSubtitle"; |
| 15 UIImage* image = [[UIImage alloc] init]; |
| 16 SuggestionsArticleItem* item = |
| 17 [[SuggestionsArticleItem alloc] initWithType:0 |
| 18 title:title |
| 19 subtitle:subtitle |
| 20 image:image]; |
| 21 SuggestionsArticleCell* cell = [[[item cellClass] alloc] init]; |
| 22 EXPECT_TRUE([cell isMemberOfClass:[SuggestionsArticleCell class]]); |
| 23 |
| 24 [item configureCell:cell]; |
| 25 EXPECT_EQ(title, cell.titleLabel.text); |
| 26 EXPECT_EQ(subtitle, cell.subtitleLabel.text); |
| 27 EXPECT_EQ(image, cell.imageView.image); |
| 28 } |
| 29 |
| 30 } // namespace |
OLD | NEW |