unit testing - Basic NMock database examples for CRUD application -


I'm looking for some basic examples of using NMock2 to duplicate database calls for CRM applications.

"post-text" itemprop = "text">

setup:

 

code> [setup ] Public zero setup () {vocal = new joke (); Mokdibeiler = _mocks.NewMock & lt; IDBLayer & gt; (); // Dependence inject anyway = new SUT (_mockDBLayer); }

Test:

  [test] Public Zero testMethodName_TestCase () {var dbRetrunValue = // Whatever is expected. Once. On (mockDBLayer) Method ("dbMethod") will (Return.Value (dbRetrunValue)). // Exercise var real = sut.methodName (); // Corruption ...}  

Verification if you want it

  [Tyrund] Public Zero Tyrund () {mocks.VerifyAllExpectationsHaveBeenMet (); }  

I like though:


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -