Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: pkg/gcloud/test/db/model_db_test.dart

Issue 804973002: Add appengine/gcloud/mustache dependencies. (Closed) Base URL: git@github.com:dart-lang/pub-dartlang-dart.git@master
Patch Set: Added AUTHORS/LICENSE/PATENTS files Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/gcloud/test/db/model_db_test.dart
diff --git a/pkg/gcloud/test/db/model_db_test.dart b/pkg/gcloud/test/db/model_db_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..bf8be81957f0a25d6322cee4ef7662a055996c21
--- /dev/null
+++ b/pkg/gcloud/test/db/model_db_test.dart
@@ -0,0 +1,53 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library gcloud.db_impl_test;
+
+import 'dart:async';
+
+import 'package:gcloud/db.dart';
+import 'package:unittest/unittest.dart';
+
+
+// These unused imports make sure that [ModelDBImpl.fromLibrary()] will find
+// all the Model/ModelDescription classes.
+import 'model_dbs/duplicate_kind.dart' as test1;
+import 'model_dbs/duplicate_property.dart' as test2;
+import 'model_dbs/multiple_annotations.dart' as test3;
+import 'model_dbs/duplicate_fieldname.dart' as test4;
+import 'model_dbs/no_default_constructor.dart' as test5;
+
+main() {
+ newModelDB(Symbol symbol)=> new ModelDBImpl.fromLibrary(symbol);
+
+ group('model_db', () {
+ group('from_library', () {
+ test('duplicate_kind', () {
+ expect(new Future.sync(() {
+ newModelDB(#gcloud.db.model_test.duplicate_kind);
+ }), throwsA(isStateError));
+ });
+ test('duplicate_property', () {
+ expect(new Future.sync(() {
+ newModelDB(#gcloud.db.model_test.duplicate_property);
+ }), throwsA(isStateError));
+ });
+ test('multiple_annotations', () {
+ expect(new Future.sync(() {
+ newModelDB(#gcloud.db.model_test.multiple_annotations);
+ }), throwsA(isStateError));
+ });
+ test('duplicate_fieldname', () {
+ expect(new Future.sync(() {
+ newModelDB(#gcloud.db.model_test.duplicate_fieldname);
+ }), throwsA(isStateError));
+ });
+ test('no_default_constructor', () {
+ expect(new Future.sync(() {
+ newModelDB(#gcloud.db.model_test.no_default_constructor);
+ }), throwsA(isStateError));
+ });
+ });
+ });
+}
« no previous file with comments | « pkg/gcloud/test/db/e2e/metamodel_test_impl.dart ('k') | pkg/gcloud/test/db/model_dbs/duplicate_fieldname.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698