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

Side by Side Diff: ios/chrome/browser/ui/suggestions/suggestions_article_item_unittest.mm

Issue 2633243003: Use ARC for Suggestions tests (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
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/ui/suggestions/suggestions_article_item.h" 5 #import "ios/chrome/browser/ui/suggestions/suggestions_article_item.h"
6 6
7 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
8 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
9 8
9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support."
11 #endif
12
10 namespace { 13 namespace {
11 14
15 // Tests that configureCell: set all the fields of the cell.
12 TEST(SuggestionsArticleItemTest, CellIsConfigured) { 16 TEST(SuggestionsArticleItemTest, CellIsConfigured) {
13 NSString* title = @"testTitle"; 17 NSString* title = @"testTitle";
14 NSString* subtitle = @"testSubtitle"; 18 NSString* subtitle = @"testSubtitle";
15 UIImage* image = [[UIImage alloc] init]; 19 UIImage* image = [[UIImage alloc] init];
16 SuggestionsArticleItem* item = 20 SuggestionsArticleItem* item =
17 [[SuggestionsArticleItem alloc] initWithType:0 21 [[SuggestionsArticleItem alloc] initWithType:0
18 title:title 22 title:title
19 subtitle:subtitle 23 subtitle:subtitle
20 image:image]; 24 image:image];
21 SuggestionsArticleCell* cell = [[[item cellClass] alloc] init]; 25 SuggestionsArticleCell* cell = [[[item cellClass] alloc] init];
22 EXPECT_TRUE([cell isMemberOfClass:[SuggestionsArticleCell class]]); 26 EXPECT_TRUE([cell isMemberOfClass:[SuggestionsArticleCell class]]);
23 27
24 [item configureCell:cell]; 28 [item configureCell:cell];
25 EXPECT_EQ(title, cell.titleLabel.text); 29 EXPECT_EQ(title, cell.titleLabel.text);
26 EXPECT_EQ(subtitle, cell.subtitleLabel.text); 30 EXPECT_EQ(subtitle, cell.subtitleLabel.text);
27 EXPECT_EQ(image, cell.imageView.image); 31 EXPECT_EQ(image, cell.imageView.image);
28 } 32 }
29 33
30 } // namespace 34 } // namespace
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/suggestions/BUILD.gn ('k') | ios/chrome/browser/ui/suggestions/suggestions_expandable_item_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698