◆ setUp
◆ tearDown
◆ testResetClearsData
- (void) testResetClearsData |
|
|
|
|
implementation |
Definition at line 15 of file FlutterRestorationPluginTest.mm.
193 {
197
198 NSData*
data = [@"testrestortiondata" dataUsingEncoding:NSUTF8StringEncoding];
203 result:^(id _Nullable result) {
204 XCTAssertNil(result);
205 }];
206 XCTAssertEqualObjects([restorationPlugin restorationData],
data);
207
208 [restorationPlugin
reset];
209 XCTAssertNil([restorationPlugin restorationData]);
210
211 __block id capturedResult;
214 result:^(id _Nullable result) {
215 capturedResult = result;
216 }];
217 XCTAssertEqual([capturedResult
count], 1u);
218 XCTAssertEqual([capturedResult objectForKey:@"enabled"], @YES);
219}
instancetype methodCallWithMethodName:arguments:(NSString *method,[arguments] id _Nullable arguments)
void markRestorationComplete()
void handleMethodCall:result:(FlutterMethodCall *call, [result] FlutterResult result)
instancetype typedDataWithBytes:(NSData *data)
std::shared_ptr< const fml::Mapping > data
◆ testRespondsRightAwayWhenDataIsSet
- (void) testRespondsRightAwayWhenDataIsSet |
|
|
|
|
implementation |
Definition at line 15 of file FlutterRestorationPluginTest.mm.
100 {
103
104 NSData*
data = [@"testrestortiondata" dataUsingEncoding:NSUTF8StringEncoding];
106
107 __block id capturedResult;
110 result:^(id _Nullable result) {
111 capturedResult = result;
112 }];
113 XCTAssertEqual([capturedResult
count], 2u);
114 XCTAssertEqual([capturedResult objectForKey:@"enabled"], @YES);
115 XCTAssertEqualObjects([[capturedResult objectForKey:
@"data"]
data],
data);
116}
void setRestorationData:(NSData *data)
◆ testRespondsRightAwayWithNoDataWhenRestorationIsCompleted
- (void) testRespondsRightAwayWithNoDataWhenRestorationIsCompleted |
|
|
|
|
implementation |
Definition at line 15 of file FlutterRestorationPluginTest.mm.
135 {
138
140
141 __block id capturedResult;
144 result:^(id _Nullable result) {
145 capturedResult = result;
146 }];
147 XCTAssertEqual([capturedResult
count], 1u);
148 XCTAssertEqual([capturedResult objectForKey:@"enabled"], @YES);
149}
◆ testRespondsWithDataSetByFramework
- (void) testRespondsWithDataSetByFramework |
|
|
|
|
implementation |
Definition at line 15 of file FlutterRestorationPluginTest.mm.
167 {
171
172 NSData*
data = [@"testrestortiondata" dataUsingEncoding:NSUTF8StringEncoding];
177 result:^(id _Nullable result) {
178 XCTAssertNil(result);
179 }];
180 XCTAssertEqualObjects([restorationPlugin restorationData],
data);
181
182 __block id capturedResult;
185 result:^(id _Nullable result) {
186 capturedResult = result;
187 }];
188 XCTAssertEqual([capturedResult
count], 2u);
189 XCTAssertEqual([capturedResult objectForKey:@"enabled"], @YES);
190 XCTAssertEqualObjects([[capturedResult objectForKey:
@"data"]
data],
data);
191}
◆ testRespondsWithNoDataWhenRestorationIsCompletedWithoutData
- (void) testRespondsWithNoDataWhenRestorationIsCompletedWithoutData |
|
|
|
|
implementation |
Definition at line 15 of file FlutterRestorationPluginTest.mm.
118 {
121
123 __block id capturedResult;
125 result:^(id _Nullable result) {
126 capturedResult = result;
127 }];
128 XCTAssertNil(capturedResult);
129
131 XCTAssertEqual([capturedResult
count], 1u);
132 XCTAssertEqual([capturedResult objectForKey:@"enabled"], @YES);
133}
◆ testRestorationDisabledRespondsRightAway
- (void) testRestorationDisabledRespondsRightAway |
|
|
|
|
implementation |
Definition at line 15 of file FlutterRestorationPluginTest.mm.
86 {
89
91 __block id capturedResult;
93 result:^(id _Nullable result) {
94 capturedResult = result;
95 }];
96 XCTAssertEqual([capturedResult
count], 1u);
97 XCTAssertEqual([capturedResult objectForKey:@"enabled"], @NO);
98}
◆ testRestorationEnabledWaitsForData
- (void) testRestorationEnabledWaitsForData |
|
|
|
|
implementation |
Definition at line 15 of file FlutterRestorationPluginTest.mm.
67 {
70
72 __block id capturedResult;
74 result:^(id _Nullable result) {
75 capturedResult = result;
76 }];
77 XCTAssertNil(capturedResult);
78
79 NSData*
data = [@"testrestortiondata" dataUsingEncoding:NSUTF8StringEncoding];
81 XCTAssertEqual([capturedResult
count], 2u);
82 XCTAssertEqual([capturedResult objectForKey:@"enabled"], @YES);
83 XCTAssertEqualObjects([[capturedResult objectForKey:
@"data"]
data],
data);
84}
◆ testRestoratonViewControllerEncodeAndDecode
- (void) testRestoratonViewControllerEncodeAndDecode |
|
|
|
|
implementation |
Definition at line 15 of file FlutterRestorationPluginTest.mm.
41 {
43 project:nil
44 allowHeadlessExecution:YES
45 restorationEnabled:YES];
50
51 NSData*
data = [@"testrestortiondata" dataUsingEncoding:NSUTF8StringEncoding];
53
54 NSKeyedArchiver* archiver = [[NSKeyedArchiver alloc] initRequiringSecureCoding:YES];
56
58
59 NSKeyedUnarchiver* unarchiver =
60 [[NSKeyedUnarchiver alloc] initForReadingWithData:archiver.encodedData];
62
63 XCTAssert([[restorationPlugin restorationData] isEqualToData:
data],
64 "Restoration state data must be equal");
65}
void decodeRestorableStateWithCoder:(NSCoder *coder)
FlutterRestorationPlugin * restorationPlugin()
void encodeRestorableStateWithCoder:(NSCoder *coder)
◆ testReturnsDataSetByFramework
- (void) testReturnsDataSetByFramework |
|
|
|
|
implementation |
Definition at line 15 of file FlutterRestorationPluginTest.mm.
151 {
155
156 NSData*
data = [@"testrestortiondata" dataUsingEncoding:NSUTF8StringEncoding];
161 result:^(id _Nullable result) {
162 XCTAssertNil(result);
163 }];
164 XCTAssertEqualObjects([restorationPlugin restorationData],
data);
165}
The documentation for this class was generated from the following file: