public void GivenASubDivision_WhenSaveSubDivision_ThenRepoReturnsTrue() { //Given var division = new Division("test", "original", 0, null); var subdivision = new Division("test", "original", 0, division.Id); var options = new DbContextOptionsBuilder <ParkSharkContext>() .UseInMemoryDatabase("parkshark" + Guid.NewGuid().ToString("n")) .Options; var result = false; //When using (var context = new ParkSharkContext(options)) { IDivisionRepository divisionRepository = new DivisionRepository(context); divisionRepository.SaveNewDivision(division); result = divisionRepository.SaveNewDivision(subdivision); } //Then Assert.True(result); }