public void CreatePerson_SubmitId_ReturnsNullValue() { var peopleList = new PeopleList(); var person = new Person() { Id = 2, Name = "Micael Ståhl", City = "Vetlanda", PhoneNumber = "0725539574" }; var result = peopleList.CreatePerson(person); Assert.Null(result); }
public void CreatePerson_SubmitValidPerson_ReturnsCreatedPerson() { var peopleList = new PeopleList(); var person = new Person() { Name = "Micael Ståhl", City = "Vetlanda", PhoneNumber = "0725539574" }; var result = peopleList.CreatePerson(person); Assert.Equal(2, result.Id); Assert.Equal(person.Name, result.Name); Assert.Equal(person.City, result.City); Assert.Equal(person.PhoneNumber, result.PhoneNumber); }
public void CreatePerson_SubmitValidPerson_Returns3PeopleInList() { var peopleList = new PeopleList(); var person = new Person() { Name = "Micael Ståhl", City = "Vetlanda", PhoneNumber = "0725539574" }; var pvm = new PersonViewModel(); var result = peopleList.CreatePerson(person); pvm.PersonList = peopleList.AllPeople(); Assert.Equal(3, pvm.PersonList.Count); }