public async Task Should_ReturnEmptyList_When_PassInvalidCompanyId() { // Arrange var leaveType = new LeaveTypeDb() { LeaveTypeId = 1, CompanyId = 1, CreatedAt = DateTime.Now, CreatedBy = -1, IsDeleted = false, IsActive = true }; _fixture.Context.LeaveTypes.Add(leaveType); _fixture.Context.SaveChanges(); IRepository <LeaveTypeDb> repository = new Repository <LeaveTypeDb>(_fixture.Context); var handler = new GetLeaveTypeListHandler(repository, _mapper, _logger); var queryRequest = new GetLeaveTypeListQuery(companyId: -1); // Act var tcs = new CancellationToken(); var result = await handler.Handle(queryRequest, tcs); // Assert Assert.Empty(result); }
public async Task Should_ReturnEmptyList_When_PassValidCompanyId() { // Arrange IRepository <LeaveTypeDb> repository = new Repository <LeaveTypeDb>(_fixture.Context); var handler = new GetLeaveTypeListHandler(repository, _mapper, _logger); var request = new GetLeaveTypeListQuery(companyId: 3); // Act var tcs = new CancellationToken(); var result = await handler.Handle(request, tcs); // Assert Assert.Empty(result); }