public void AfterEachTest() { using (var context = new SagaContext()) { var sagaData = context.SagaData.FirstOrDefault(s => s.Id == saga.Id); if (sagaData != null) { context.SagaData.Remove(sagaData); } context.SaveChanges(); } }
public void CanSaveSaga() { uow.Begin(); persister.Save(saga); uow.End(); using (var context = new SagaContext()) { var sagaData = context.SagaData.FirstOrDefault(s => s.Id == saga.Id); context.SagaData.Remove(sagaData); context.SaveChanges(); Assert.IsNotNull(sagaData); Assert.IsNotNull(sagaData.Data); Assert.IsNotNull(sagaData.UniqueProperty); Assert.AreEqual(1, sagaData.Version); } }