public void ParameterArgumentNullCheck() { // Arrange var sut = new GetUserByIdHandler(); // Act & Assert Assert.ThrowsAsync <ArgumentException>(() => sut.ExecuteAsync(null !)); }
public void InstantiateConstructor() { // Act var actual = new GetUserByIdHandler(); // Assert Assert.NotNull(actual); }
public async void SouldReturnSuccess_WhenListUser() { // arrange var(repo, context) = GetRepository(); var entity = new UserEntity { Email = "*****@*****.**", Name = "test1", Password = "******" }; _ = await repo.Save(entity); var comando = new GetUserByIdCommand { Id = 1 }; var handler = new GetUserByIdHandler(repo); // act var ret = await handler.Handle(comando, CancellationToken.None); // assert var result = context.UserEntityDb.Find(comando.Id); Assert.True(ret.Data.Email == result.Email); }
public GetUserByIdHandlerTest() { _authRepository = Substitute.For <IAuthRepository>(); _handler = new GetUserByIdHandler(_authRepository); }