public void RemoveLayout() { try { var options = CreateNewContextOptions(); using (var db = new AuctionContext(options)) { AuctionTestHelper.PopulateDefaultData(db); } using (var db = new AuctionContext(options)) { var repository = new AuctionRepository(db); var item = GenerateModel(); Assert.DoesNotThrow(() => repository.Save(item)); var layout = new AuctionLayout { Title = "title", Description = "description", Layout = GenerateAttachment(), AuctionId = item.Id }; Assert.DoesNotThrow(() => repository.AddLayout(item, layout)); Assert.DoesNotThrow(() => repository.RemoveLayout(item, layout)); } } catch (Exception ex) { LogEventManager.Logger.Error(ex); throw; } }