Skip to content

Commit

Permalink
add unit tests base class for ContextViewExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoschenkel committed Sep 19, 2016
1 parent 6935e40 commit a217d0d
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// ------------------------------------------------------------------------------
// Copyright (c) 2016 Goodgame Studios. All Rights Reserved.
//
// NOTICE: You are permitted to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
// ------------------------------------------------------------------------------

import { assert } from "chai";

import {
IContext,
Context,
LifecycleError
} from "robotlegs";

import { ContextViewExtension } from "../../../../../src/robotlegs/bender/extensions/contextView/ContextViewExtension";

describe("ContextViewExtension", () => {

let context: IContext;

beforeEach(() => {
context = new Context();
});

afterEach(() => {
context = null;
});

it("installing after initialization throws error", () => {
function installExtensionAfterInitialization(): void {
context.initialize();
context.install(ContextViewExtension);
}
assert.throws(installExtensionAfterInitialization, LifecycleError);
});
});

0 comments on commit a217d0d

Please sign in to comment.