mirror of
https://github.com/tappollo/IGListKit.git
synced 2026-05-12 16:23:41 +08:00
Summary: Adding and implementing an example of a new section controller that can be configured with a type. This section controller automatically stores its object in `didUpdateToObject:`, and implementations can trust the type-safety of the object! Reviewed By: jessesquires Differential Revision: D4914179 fbshipit-source-id: 39e2dce8ca29a1c0c92dc78eb8c25a7ab0a21978
28 lines
789 B
Objective-C
28 lines
789 B
Objective-C
/**
|
|
* Copyright (c) 2016-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
#import <XCTest/XCTest.h>
|
|
|
|
#import <IGListKit/IGListGenericSectionController.h>
|
|
|
|
@interface IGListGenericSectionControllerTests : XCTestCase
|
|
|
|
@end
|
|
|
|
@implementation IGListGenericSectionControllerTests
|
|
|
|
- (void)test_whenUpdatingToObject_thatSameObjectIsStored {
|
|
IGListGenericSectionController<NSString *> *controller = [IGListGenericSectionController new];
|
|
NSString *foo = @"foo";
|
|
[controller didUpdateToObject:foo];
|
|
XCTAssertEqual(controller.object, foo);
|
|
}
|
|
|
|
@end
|