| 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_stack_item.h" |
| 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 10 #error "This file requires ARC support." |
| 11 #endif |
| 12 |
| 13 namespace { |
| 14 |
| 15 // Tests that configureCell: set all the fields of the cell. |
| 16 TEST(SuggestionsStackItemTest, CellIsConfigured) { |
| 17 NSString* title = @"testTitle"; |
| 18 NSString* subtitle = @"testSubtitle"; |
| 19 SuggestionsStackItem* item = |
| 20 [[SuggestionsStackItem alloc] initWithType:0 |
| 21 title:title |
| 22 subtitle:subtitle]; |
| 23 SuggestionsStackCell* cell = [[[item cellClass] alloc] init]; |
| 24 EXPECT_TRUE([cell isMemberOfClass:[SuggestionsStackCell class]]); |
| 25 |
| 26 [item configureCell:cell]; |
| 27 EXPECT_EQ(title, [cell.titleButton titleForState:UIControlStateNormal]); |
| 28 EXPECT_EQ(subtitle, cell.detailTextLabel.text); |
| 29 } |
| 30 |
| 31 } // namespace |
| OLD | NEW |