[fidl][dart] Add table API tests

Test: fx test -v fidl_bindings_test
Change-Id: I6bef3d1dc0e9c12647adf73388f6753c90724709
Reviewed-on: https://fuchsia-review.googlesource.com/c/topaz/+/442575
Commit-Queue: Felix Zhu <fcz@google.com>
Reviewed-by: Pascal Perez <pascallouis@google.com>
Testability-Review: Pascal Perez <pascallouis@google.com>
diff --git a/bin/fidl_bindings_test/test/BUILD.gn b/bin/fidl_bindings_test/test/BUILD.gn
index 2694e08..a8f0e89 100644
--- a/bin/fidl_bindings_test/test/BUILD.gn
+++ b/bin/fidl_bindings_test/test/BUILD.gn
@@ -32,6 +32,7 @@
     "hash_test.dart",
     "header_test.dart",
     "oneway_test.dart",
+    "table_test.dart",
     "state_test.dart",
     "tostring_test.dart",
     "twoway_test.dart",
diff --git a/bin/fidl_bindings_test/test/test/table_test.dart b/bin/fidl_bindings_test/test/test/table_test.dart
new file mode 100644
index 0000000..a80ffef
--- /dev/null
+++ b/bin/fidl_bindings_test/test/test/table_test.dart
@@ -0,0 +1,31 @@
+// Copyright 2020 The Fuchsia 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 'dart:typed_data';
+
+import 'package:fidl/fidl.dart';
+import 'package:test/test.dart';
+import 'package:fidl_fidl_examples_bindingstest/fidl_async.dart';
+
+void main() {
+  group('tables', () {
+    test('withUnknown', () {
+      final data =
+          UnknownRawData(Uint8List.fromList([1, 2, 3, 4, 5, 6, 7, 8]), []);
+      final table = ExampleTable(bar: 1, $unknownData: {4: data});
+      expect(table.foo, isNull);
+      expect(table.bar, equals(1));
+      expect(table.baz, isNull);
+      expect(table.$unknownData, {4: data});
+    });
+
+    test('noUnknown', () {
+      final table = ExampleTable(foo: 'foo', bar: 3);
+      expect(table.foo, equals('foo'));
+      expect(table.bar, equals(3));
+      expect(table.baz, isNull);
+      expect(table.$unknownData, isNull);
+    });
+  });
+}