[Time Controller] Begin adding test cases

WTD-1515
This commit is contained in:
Victor Woeltjen
2015-09-04 10:32:01 -07:00
parent a481b377cb
commit f83588d980
2 changed files with 50 additions and 1 deletions

View File

@@ -29,8 +29,30 @@ define(
function (ConductorService) {
"use strict";
describe("ConductorService", function () {
var TEST_NOW = 1020304050;
describe("ConductorService", function () {
var mockNow,
conductorService;
beforeEach(function () {
mockNow = jasmine.createSpy('now');
mockNow.andReturn(TEST_NOW);
conductorService = new ConductorService(mockNow);
});
it("initializes a time conductor around the current time", function () {
var conductor = conductorService.getConductor();
expect(conductor.queryStart() <= TEST_NOW).toBeTruthy();
expect(conductor.queryEnd() >= TEST_NOW).toBeTruthy();
expect(conductor.queryEnd() > conductor.queryStart())
.toBeTruthy();
});
it("provides a single shared time conductor instance", function () {
expect(conductorService.getConductor())
.toBe(conductorService.getConductor());
});
});
}
);