Ejemplo n.º 1
0
        public void ShouldBeAbleToAddAPerson()
        {
            var firstName = "Wilma";
            var lastName = "Filnstone";
            var userId = 3;

            Mock.Arrange(() => _personRepository
                .SavePerson(Arg.Matches<WebDirectory.Core.Person>(x => x.FirstName == firstName && x.LastName == lastName)))
                .Returns(userId);

            var savedPerson = new WebDirectory.Web.Core.Models.ViewModels.Person { FirstName = firstName, LastName = lastName, UserId = userId };

            var result = _personModel.SavePerson(savedPerson);

            Assert.AreEqual(userId, result);
        }
Ejemplo n.º 2
0
 public int SavePerson(int id, Person person)
 {
     return _personRepository.SavePerson(id, Mapper.Map<Person, WebDirectory.Core.Person>(person));
 }