public async Task Invalidate_request_when_no_user_found_by_sub(string sub) { // Arrange var sut = new GetGroupInvitesValidator(_dbContext); // Act bool isValid = await sut.IsValidAsync(new GetGroupInvites(sub)); // Assert isValid.ShouldBeFalse(); }
public async Task Validate_when_user_was_found_by_sub() { var sut = new GetGroupInvitesValidator(_dbContext); // Arrange string userSub = Guid.NewGuid().ToString(); await _dbContext.Users.AddAsync(new DeUrgenta.Domain.Entities.User { FirstName = "Integration", LastName = "Test", Sub = userSub }); await _dbContext.SaveChangesAsync(); // Act bool isValid = await sut.IsValidAsync(new GetGroupInvites(userSub)); // Assert isValid.ShouldBeTrue(); }