public async Task GetPersonByName_Should_Throw_ArgumentNullException_If_Name_Is_Null()
        {
            PersonServiceMock mock = PersonServiceMock.Create();

            string name = null;

            await Assert.ThrowsAsync <ArgumentNullException>(() => mock.GetPersonByName(name));

            mock.PersonRepository.Verify(repository => repository.GetPersonByName(It.IsAny <string>()), Times.Never);
        }
        public async Task GetPersonByName_Should_Call_IPersonRepository_GetPersonByName()
        {
            PersonServiceMock mock = PersonServiceMock.Create();

            var id   = 1;
            var name = "Barış Özaydın";

            mock.PersonRepository
            .Setup(repository => repository.GetPersonByName(It.Is <string>(i => i == name)))
            .ReturnsAsync(() => new Person()
            {
                Id = id, Name = name
            });

            Person person = await mock.GetPersonByName(name);

            mock.PersonRepository.Verify(repository => repository.GetPersonByName(It.IsAny <string>()), Times.Once);
            Assert.NotNull(person);
        }