示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }