-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
ListTest.m
42 lines (35 loc) · 1.41 KB
/
ListTest.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@import Flutter;
@import XCTest;
#ifdef LEGACY_HARNESS
#import "List.gen.h"
#else
@import alternate_language_test_plugin;
#endif
#import "EchoMessenger.h"
///////////////////////////////////////////////////////////////////////////////////////////
@interface ListTest : XCTestCase
@end
///////////////////////////////////////////////////////////////////////////////////////////
@implementation ListTest
- (void)testListInList {
TestMessage *top = [[TestMessage alloc] init];
TestMessage *inside = [[TestMessage alloc] init];
inside.testList = @[ @1, @2, @3 ];
top.testList = @[ inside ];
EchoBinaryMessenger *binaryMessenger =
[[EchoBinaryMessenger alloc] initWithCodec:EchoApiGetCodec()];
EchoApi *api = [[EchoApi alloc] initWithBinaryMessenger:binaryMessenger];
XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
[api echoMsg:top
completion:^(TestMessage *_Nonnull result, NSError *_Nullable err) {
XCTAssertEqual(1u, result.testList.count);
XCTAssertTrue([result.testList[0] isKindOfClass:[TestMessage class]]);
XCTAssertEqualObjects(inside.testList, [result.testList[0] testList]);
[expectation fulfill];
}];
[self waitForExpectations:@[ expectation ] timeout:1.0];
}
@end