public void SetsSameDbContext() { //Arrange var mockedContext = new Mock <INoleggioDbContext>(); //Act var actulaUnitOfWork = new FakeUnitOfWork(mockedContext.Object); //Assert Assert.AreSame(mockedContext.Object, actulaUnitOfWork.DbContext); }
public void SetsSameDbContext() { //Arrange var mockedContext = new Mock <INoleggioDbContext>(); mockedContext.Setup(x => x.SaveChanges()).Verifiable(); var actulaUnitOfWork = new FakeUnitOfWork(mockedContext.Object); //Act actulaUnitOfWork.Commit(); //Assert mockedContext.Verify(x => x.SaveChanges(), Times.Once); }