private void attach_Reis(Reis entity) { this.SendPropertyChanging(); entity.BasicReis = this; }
private void detach_Reis(Reis entity) { this.SendPropertyChanging(); entity.BasicReis = null; }
partial void UpdateReis(Reis instance);
partial void DeleteReis(Reis instance);
public void TestReisAddGetUpdateDelete() { //Add-Get-Тест DateTime date = DateTime.Now; Reis expectedReis = new Reis(); expectedReis.Date = date; DataAccessReis reis = new DataAccessReis(); reis.AddElement(expectedReis); var actualReis = reis.GetAll().Last(); Assert.AreEqual(expectedReis, actualReis); //Update - Тест expectedReis = actualReis; expectedReis.Date = date.AddDays(2); reis.UpdateElement(expectedReis); actualReis = reis.GetElement(expectedReis.CodeReis); Assert.AreEqual(expectedReis, actualReis); //Delete-Тест int expectedCount = reis.GetAll().Count() - 1; reis.DeleteElement(actualReis); int actualCount = reis.GetAll().Count(); Assert.AreEqual(expectedCount, actualCount); }
partial void InsertReis(Reis instance);