public async Task BetRepository_DeleteByIdAsync_DeletesBet() { var mockDbSet = UnitTestHelper.GetMockDbSet <Bet>(GetTestBets()); var mockContext = GetMockContext(mockDbSet); var betRepo = new BetRepository(mockContext.Object); var bet = new Bet { Id = 1, BetDate = new DateTime(2020, 11, 04), LotId = 1 }; await betRepo.DeleteByIdAsync(1); mockDbSet.Verify( m => m.Remove(It.Is <Bet>( l => l.Id == bet.Id && l.BetDate == bet.BetDate && l.LotId == bet.LotId)), Times.Once); }