Created
July 11, 2012 21:48
Revisions
-
waldyrfelix created this gist
Jul 11, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ public static Mock<IUnitOfWork> MockUnitOfWork() { var mockUnitOfWork = new Mock<IUnitOfWork>(); var mockUnitOfWorkFactory = new Mock<IUnitOfWorkFactory>(); mockUnitOfWorkFactory.Setup(_ => _.Criar()) .Returns(mockUnitOfWork.Object); var mockServiceLocator = new Mock<IServiceLocator>(); mockServiceLocator.Setup(_ => _.GetInstance<IUnitOfWorkFactory>()) .Returns(mockUnitOfWorkFactory.Object); ServiceLocator.SetLocatorProvider(() => mockServiceLocator.Object); return mockUnitOfWork; }