コード例 #1
0
        public async Task Index_UpdatePersonPostAddsPersonAndReturnsRedirect()
        {
            var firstName    = "tim";
            var surname      = "test";
            var dateOfBirth  = new DateTime(2000, 1, 1);
            var emailAddress = "*****@*****.**";

            var result = await _controller.UpdatePerson(new PersonViewModel { FirstName = firstName, Surname = surname, DateOfBirth = dateOfBirth, EmailAddress = emailAddress });

            await _partyRespository.Received().AddPerson(Arg.Is <Person>(o =>
                                                                         o.FirstName == firstName &&
                                                                         o.Surname == surname &&
                                                                         o.DateOfBirth == dateOfBirth &&
                                                                         o.EmailAddress == emailAddress));

            Assert.IsTrue(result is RedirectToActionResult);
        }