public void UpdateReciept_Shuould_Save_Chanes_In_The_Database() { var reciepts = new RecieptManager(); //Add new reciept var originalReciept = new Reciept(); originalReciept.KingdomHallFund = 100; originalReciept.WorldWideWork = 100; originalReciept.Congregation = 200; reciepts.AddReciept(originalReciept); //change something originalReciept.KingdomHallFund = 33; reciepts.UpdateReciept(originalReciept); //get it back out of the DB var newReciept = reciepts.GetReciept(originalReciept.ID); //Compare it if (newReciept.ID != originalReciept.ID || newReciept.Congregation != originalReciept.Congregation || newReciept.KingdomHallFund != originalReciept.KingdomHallFund || newReciept.WorldWideWork != originalReciept.WorldWideWork || newReciept.Miscellaneous1 != originalReciept.Miscellaneous1 || newReciept.Miscellaneous1Name != originalReciept.Miscellaneous1Name || newReciept.Miscellaneous2 != originalReciept.Miscellaneous2 || newReciept.Miscellaneous2Name != originalReciept.Miscellaneous2Name || newReciept.Date != originalReciept.Date) { Assert.Fail(); } }
public void GetReciept_Should_Return_A_Previously_Saved_Reciept() { var reciepts = new RecieptManager(); //Add new reciept var reciept = new Reciept(); reciept.KingdomHallFund = 100; reciept.WorldWideWork = 100; reciept.Congregation = 200; reciepts.AddReciept(reciept); //get it back out of the DB var newReciept = reciepts.GetReciept(reciept.ID); Assert.IsNotNull(newReciept); //Compare it if (newReciept.ID != reciept.ID || newReciept.Congregation != reciept.Congregation || newReciept.KingdomHallFund != reciept.KingdomHallFund || newReciept.WorldWideWork != reciept.WorldWideWork || newReciept.Miscellaneous1 != reciept.Miscellaneous1 || newReciept.Miscellaneous1Name != reciept.Miscellaneous1Name || newReciept.Miscellaneous2 != reciept.Miscellaneous2 || newReciept.Miscellaneous2Name != reciept.Miscellaneous2Name || newReciept.Date != reciept.Date) { Assert.Fail(); } }
public void RemoveReciept_Shuould_Delete_A_Reciept_From_The_Database() { var reciepts = new RecieptManager(); //Add new reciept var reciept = new Reciept(); reciept.KingdomHallFund = 100; reciept.WorldWideWork = 100; reciept.Congregation = 200; reciepts.AddReciept(reciept); //Make sure its there Assert.IsNotNull(reciepts.GetReciept(reciept.ID)); //Now Delete it reciepts.RemoveReciept(reciept); //Make sure its NOT there Assert.IsNull(reciepts.GetReciept(reciept.ID)); }
public void GetReciept_Shuould_Return_Null_If_Reciept_Was_Not_Found() { var reciepts = new RecieptManager(); Assert.IsNull(reciepts.GetReciept(Guid.NewGuid())); }