Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 480 Bytes

README.md

File metadata and controls

33 lines (23 loc) · 480 Bytes

TypeScriptMock

This a thin wrapper around jasmine spies that allows

Example usage:

export interface IBiz{ 
	helloWorld():string
}

export class Program{ 
	private _biz:IBiz; 
	constructor(biz:IBiz){
  		this._biz = biz;
	}

	public printHelloWorld()
	{ 
		console.log(this._biz.helloWorld()); 
	}
 }




var mock = new Mock<IBiz>();
mock.setup(p=>p.helloWorld).andReturns("Hey");

//use the mock
var p = new Program(mock.getObject());
p.printHelloWorld();