public async Task CreateUserCommand_CustomerDataCreateOnDatabase() { //Arange var writeIRepositoryMoq = new Mock <IWriteIRepository>(); var readRepositoryMoq = new Mock <IReadRepository>(); var config = new MapperConfiguration(cfg => cfg.AddProfile <NotifikationProfile>()); IMapper mapper = config.CreateMapper(); var command = new CreateUserCommand() { User = new UserDTO() { Email = "*****@*****.**", Name = "test" } }; var handler = new CreateUserCommandHandler(writeIRepositoryMoq.Object, readRepositoryMoq.Object, mapper); //Act UserDTO x = await handler.Handle(command, new System.Threading.CancellationToken()); //Asert writeIRepositoryMoq.Verify(x => x.Add <UserEntity>(It.IsAny <UserEntity>())); }