Esempio n. 1
0
        public async Task <ActionResult> Create(EmailModel email)
        {
            var emailDto = _mapper.Map <Email>(email);
            await _emailManager.Create(emailDto);

            return(Ok());
        }
Esempio n. 2
0
        public async Task GivenEmail_WhenCreate_ThenCreateSuccessful()
        {
            //?Given
            var email = new Email
            {
                Id           = "1234",
                UserName     = "******",
                CreationTime = new DateTime()
            };

            //?When
            await _emailManager.Create(email);

            //?Then
            _mockRepository.Verify(t => t.Create(It.Is <Email>(e => EmailIsWellCreated(e, email))), Times.Once);
        }