DefconDotNet

Untitled

Feb 7th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System.Data.Entity;
  2. using Moq;
  3. using Xunit;
  4.  
  5. namespace Freelancers.Infrastructure.Tests.UnitOfWork
  6. {
  7.     public class UnitOfWorkFacts
  8.     {
  9.         public class Commit
  10.         {
  11.             [Fact]
  12.             public void WillCallSaveChanges()
  13.             {
  14.                 var contextMock = new Mock<DbContext>();
  15.                 var unitOfWork = new Infrastructure.UnitOfWork.UnitOfWork(contextMock.Object);
  16.  
  17.                 unitOfWork.Commit();
  18.  
  19.                 contextMock.Verify(x => x.SaveChanges());
  20.             }
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment