private void Arrange() { _mediator = new Mock <IAuthenticatedMediator>(); Context.Users.Add(new User() { Email = _email }); Context.SaveChanges(); _subject = new VerifyUserHandler(Context, _mediator.Object); }
private void Arrange() { _mediator = new Mock <IAuthenticatedMediator>(); _mediator.Setup(mediator => mediator.Send( It.Is <RegisterUser>(command => command.Email == _email), CancellationToken.None)) .Returns(Task.FromResult(new RegisterUserResult { UserId = _userId, TenantId = _tenantId })); _subject = new VerifyUserHandler(Context, _mediator.Object); }