public void Index_GivenRepositoryHasPeople_ShouldReturnViewWithListOfPeople()
        {
            //---------------Set up test pack-------------------
            var repo = Substitute.For<IPersonRepository>();
            var dtoList = new List<PersonDto>();
            repo.GetPeopleList().Returns(dtoList);
            var controller = new PersonController(repo);

            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            var result = controller.Index() as ViewResult;
            //---------------Test Result -----------------------
            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Model as IEnumerable);

            var mapper = new PersonMapper();
            var peopleList = mapper.MapPeopleList(dtoList);

            CollectionAssert.AreEqual((IEnumerable)result.Model, peopleList);
        }
        public void Details_GivenPersonId_ShouldReturnViewWithPersonDetails()
        {
            //---------------Set up test pack-------------------
            var repo = Substitute.For<IPersonRepository>();
            var personDto = new PersonDto { Id = 1, PersonName = "Ntokozo"};

            repo.GetPersonById(personDto.Id).Returns(personDto);

            var controller = new PersonController(repo);
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            var result = controller.Details(1) as ViewResult;
            //---------------Test Result -----------------------
            var resultPerson = (PersonViewModel) result?.ViewData.Model;

            Assert.IsNotNull(resultPerson);

            var mapper = new PersonMapper();
            var expectedItem = mapper.MapPerson(personDto);

            Assert.AreSame(expectedItem.Name, resultPerson.Name);

        }