public void GetRepository_Throws_If_T_Is_Neither_Family_Individual() { //Arrange var mockStore = new Mock <IGEDCOMStore>(); var unitOfWork = new GEDCOMUnitOfWork(mockStore.Object); //Act, Assert Assert.Throws <NotImplementedException>(() => unitOfWork.GetRepository <Note>()); }
public void GetRepository_Throws_If_T_Not_Recognised() { //Arrange var mockStore = new Mock <IGEDCOMStore>(); var unitOfWork = new GEDCOMUnitOfWork(mockStore.Object); //Act, Assert Assert.Throws <NotImplementedException>(() => unitOfWork.GetRepository <Dog>()); }
public void GetLinqRepository_Returns_FamilyRepository_If_T_Is_Family() { //Arrange var mockStore = new Mock <IGEDCOMStore>(); var unitOfWork = new GEDCOMUnitOfWork(mockStore.Object); //Act var rep = unitOfWork.GetRepository <Family>(); //Assert Assert.IsInstanceOf <GEDCOMFamilyRepository>(rep); }
public void Commit_Calls_Store_SaveChanges() { //Arrange var mockStore = new Mock <IGEDCOMStore>(); var unitOfWork = new GEDCOMUnitOfWork(mockStore.Object); //Act unitOfWork.Commit(); //Assert mockStore.Verify(s => s.SaveChanges(), Times.Once); }