public void EnsureSavePeopleWorksProperly() { FavouriteColorEntityFrameworkRepository favCSVFileRepo = new FavouriteColorEntityFrameworkRepository(); var ps = new List <Person>() { new Person() { Id = 10, Name = "John", Lastname = "Doe", City = "Sky", Zipcode = "12345", FavColourId = 1 } }; var ok = favCSVFileRepo.SavePeople(ps); Assert.IsTrue(ok); }
public void EnsureSavePeopleDealsWithEmptyPeopleInputProperly() { try { FavouriteColorEntityFrameworkRepository favCSVFileRepo = new FavouriteColorEntityFrameworkRepository(); var ps = new List <Person>(); var ok = favCSVFileRepo.SavePeople(ps); Assert.IsTrue(false); } catch (NoPeopleForUpdateException) { Assert.IsTrue(true); } }
public void EnsureSavePeopleDealsWithNullColorProperly() { try { FavouriteColorEntityFrameworkRepository favCSVFileRepo = new FavouriteColorEntityFrameworkRepository(); var ps = new List <Person>() { new Person() { Id = 10, Name = "John", Lastname = "Doe", City = "Sky", Zipcode = "12345" } }; var ok = favCSVFileRepo.SavePeople(ps); Assert.IsTrue(false); } catch (ColorIsNullException) { Assert.IsTrue(true); } }