public void ActivateById() { try { var options = CreateNewContextOptions(); using (var db = new ConversationContext(options)) { ConversationTestHelper.PopulateDefaultDataCtx(db); } using (var db = new ConversationContext(options)) { var repository = new ConversationRepository(db); var item = GenerateModel(); item.IsActive = false; Assert.DoesNotThrow(() => repository.Save(item)); Assert.DoesNotThrow(() => item = repository.Activate(item.Id)); Assert.DoesNotThrow(() => repository.Delete(item)); Assert.IsTrue(item.IsActive); } } catch (Exception ex) { LogEventManager.Logger.Error(ex); throw; } }