public void Test_ReadById_in_TrainerGateway_after_Create() { _trainer1 = _TrainerGateway.Create(_trainer1); Assert.AreNotEqual(null, _trainer1); int id = _TrainerGateway.ReadById(_trainer1.Id).Id; Assert.AreEqual(id, _trainer1.Id); }
public void Test_Update_existing_Event_with_existing_Trainer_in_EventGateway() { var trainer = _TrainerGateway.ReadById(1); Assert.AreNotEqual(null, trainer); var _event = _EventGateway.ReadById(3); Assert.AreNotEqual(null, _event); _event.Trainers.Add(trainer); int trainerIdBeforeUpdate = trainer.Id; _event = _EventGateway.Update(_event); var trainerAfterUpdate = _event.Trainers.FirstOrDefault(eventTrainer => eventTrainer.Id == trainerIdBeforeUpdate); Assert.AreEqual(trainerIdBeforeUpdate, trainerAfterUpdate.Id); }