-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f406ad
commit 460c6d5
Showing
6 changed files
with
108 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { Test, TestSuite } from "xunit.ts"; | ||
import Factory from "../App/Factory"; | ||
import Signal from "../App/Signal"; | ||
import SignalService from "../App/SignalService"; | ||
import MockFactory from "./MockFactory"; | ||
import Mockito from "ts-mockito"; | ||
import Renderer from "../App/Renderer"; | ||
import ImageLoader from "../App/ImageLoader"; | ||
|
||
export default class FactoryTests extends TestSuite { | ||
@Test() | ||
async canCreateSignalService() { | ||
//arrange | ||
const signals: Signal[] = []; | ||
|
||
const factory = new Factory(false); | ||
|
||
//act | ||
const signal_service = factory.signalService(signals); | ||
|
||
//assert | ||
this.assert.instanceOf(SignalService, signal_service); | ||
} | ||
|
||
@Test() | ||
async canCreateRenderer() { | ||
//arrange | ||
const canvas = MockFactory.canvas(); | ||
|
||
const factory = new Factory(true); | ||
|
||
//act | ||
const renderer = factory.renderer(Mockito.instance(canvas)); | ||
|
||
//assert | ||
this.assert.instanceOf(Renderer, renderer); | ||
} | ||
|
||
@Test() | ||
async canCreateImageLoader() { | ||
//arrange | ||
const factory = new Factory(true); | ||
|
||
//act | ||
const loader = factory.imageLoader(); | ||
|
||
//assert | ||
this.assert.instanceOf(ImageLoader, loader); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters