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

Side by Side Diff: packages/charted/test.disabled/core/object_factory_test.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style
5 * license that can be found in the LICENSE file or at
6 * https://developers.google.com/open-source/licenses/bsd
7 */
8
9 part of charted.test.core;
10
11 class MockObject { }
12 class MockCreateFailObject {
13 factory MockCreateFailObject() => null;
14 }
15
16 testObjectFactory() {
17 ObjectFactory factory = new ObjectFactory();
18 factory.register("mock", () => new MockObject());
19 factory.register("mockfail", () => new MockCreateFailObject());
20
21 group('ObjectFactory.create()', () {
22 test('creates an object of a registered factory', () {
23 expect(factory.create("mock"), new isInstanceOf<MockObject>());
24 });
25 test('throwsArgumentError if a factory returns null', () {
26 expect(() => factory.create("mockfail"), throwsArgumentError);
27 });
28 test('throwsArgumentError when a factory is not registered', () {
29 expect(() => factory.create("notregistered"), throwsArgumentError);
30 });
31 });
32 }
OLDNEW
« no previous file with comments | « packages/charted/test.disabled/core/namespace_test.dart ('k') | packages/charted/test.disabled/event/event_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698