Skip to content

Commit 1474e99

Browse files
author
Mr8god
committed
Refactor: format the code.
change path to 'test' directory and run command with the 'flutter format .'.
1 parent 2b3d5d0 commit 1474e99

7 files changed

+26
-15
lines changed

test/ndef_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ void testGenerate(List<String> hexStrings, List<List<NDEFRecord>> messages) {
2626

2727
void main() {
2828
test('ndef message with uri type', () {
29-
// TODO: fill in tests
3029
List<String> hexStrings = [
3130
"91011655046769746875622e636f6d2f6e6663696d2f6e64656651010b55046769746875622e636f6d",
3231
];
@@ -301,5 +300,4 @@ void main() {
301300
"d2200b6170706c69636174696f6e2f766e642e626c7565746f6f74682e65702e6f6f620b0006050403020102ff61")));
302301
});
303302

304-
// TODO: more tests
305303
}

test/test_examples_of_records/device_information_test.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ void main() {
4545
test('test the all parts of a record', () {
4646
expect(deviceInfoRecord.id, equals(null));
4747

48-
String hexStringUsedInExpect1 = "00056e6663696d01096e666344657669636502076e66634e616d6503106361ae18d5b011ea9d0840a3ccfd09570405312e302e30ff054e4643494d";
49-
expect(deviceInfoRecord.payload, equals(hexStringUsedInExpect1.toBytes()));
48+
String hexStringUsedInExpect1 =
49+
"00056e6663696d01096e666344657669636502076e66634e616d6503106361ae18d5b011ea9d0840a3ccfd09570405312e302e30ff054e4643494d";
50+
expect(
51+
deviceInfoRecord.payload, equals(hexStringUsedInExpect1.toBytes()));
5052

5153
expect(deviceInfoRecord.tnf, equals(TypeNameFormat.nfcWellKnown));
5254
expect(deviceInfoRecord.flags.runtimeType, equals(NDEFRecordFlags));
@@ -79,7 +81,8 @@ void main() {
7981
}, throwsArgumentError);
8082

8183
expect(() {
82-
String hexStringUsedInExpect2 = "01096e666344657669636502076e66634e616d6503106361ae18d5b011ea9d0840a3ccfd09570405312e302e30ff054e4643494d";
84+
String hexStringUsedInExpect2 =
85+
"01096e666344657669636502076e66634e616d6503106361ae18d5b011ea9d0840a3ccfd09570405312e302e30ff054e4643494d";
8386
deviceInfoRecord.payload = hexStringUsedInExpect2.toBytes();
8487
}, throwsArgumentError);
8588
});

test/test_examples_of_records/handover_test.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,10 @@ void main() {
386386

387387
expect(hcr.carrierData, equals([1, 2, 3]));
388388
expect(hcr.carrierTnf, equals(TypeNameFormat.nfcWellKnown));
389-
expect(hcr.basicInfoString, equals('id=(empty) typeNameFormat=TypeNameFormat.nfcWellKnown type=Hc '));
389+
expect(
390+
hcr.basicInfoString,
391+
equals(
392+
'id=(empty) typeNameFormat=TypeNameFormat.nfcWellKnown type=Hc '));
390393
});
391394
});
392395
}

test/test_examples_of_records/signature_test.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ void main() {
4545
expect(sr.tnf, equals(TypeNameFormat.nfcWellKnown));
4646
expect(sr.flags.runtimeType, equals(NDEFRecordFlags));
4747
expect(sr.signatureURI, equals(''));
48-
expect(sr.basicInfoString, equals('id=(empty) typeNameFormat=TypeNameFormat.nfcWellKnown type=Sig '));
48+
expect(
49+
sr.basicInfoString,
50+
equals(
51+
'id=(empty) typeNameFormat=TypeNameFormat.nfcWellKnown type=Sig '));
4952

5053
expect(sr.type, equals([83, 105, 103]));
5154
expect(sr.fullType, equals('urn:nfc:wkt:Sig'));

test/test_examples_of_records/smartposter_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void main() {
4343
icon: {"image/png": Uint8List.fromList(utf8.encode("a picture"))},
4444
size: 10000);
4545

46-
47-
SmartPosterRecord smartPosterRecord2 = SmartPosterRecord(uri: "https://github.com");
46+
SmartPosterRecord smartPosterRecord2 =
47+
SmartPosterRecord(uri: "https://github.com");
4848
});
4949
}

test/test_examples_of_records/text_test.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ void main() {
4343

4444
expect(tr.tnf, equals(TypeNameFormat.nfcWellKnown));
4545
expect(tr.flags.runtimeType, equals(NDEFRecordFlags));
46-
expect(tr.basicInfoString, equals('id=(empty) typeNameFormat=TypeNameFormat.nfcWellKnown type=T '));
46+
expect(
47+
tr.basicInfoString,
48+
equals(
49+
'id=(empty) typeNameFormat=TypeNameFormat.nfcWellKnown type=T '));
4750
});
4851
});
4952
}

test/utilities_test.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ void main() {
88
test('main function', () {
99
assert(ByteUtils.bytesEqual(null, null) == true);
1010
assert(ByteUtils.bytesEqual(
11-
Uint8List.fromList([1, 2, 3]), Uint8List.fromList([1, 2])) ==
11+
Uint8List.fromList([1, 2, 3]), Uint8List.fromList([1, 2])) ==
1212
false);
1313
assert(ByteUtils.bytesEqual(
14-
Uint8List.fromList([1, 2, 3]), Uint8List.fromList([1, 2, 4])) ==
14+
Uint8List.fromList([1, 2, 3]), Uint8List.fromList([1, 2, 4])) ==
1515
false);
1616
assert(ByteUtils.bytesEqual(
17-
Uint8List.fromList([1, 2, 3]), Uint8List.fromList([1, 2, 3])) ==
17+
Uint8List.fromList([1, 2, 3]), Uint8List.fromList([1, 2, 3])) ==
1818
true);
19-
assert(ByteUtils.bytesEqual(Uint8List.fromList([1, 2, 3]), null) == false);
19+
assert(
20+
ByteUtils.bytesEqual(Uint8List.fromList([1, 2, 3]), null) == false);
2021

2122
var bytes = Uint8List(0);
2223
assert(bytes.toHexString() == "");
2324
assert(Uint8List.fromList([]).toHexString() == "");
2425
});
2526
});
26-
}
27+
}

0 commit comments

Comments
 (0)