Пример #1
0
        public void AddContact_AddPersonToDatabase_RecordAddedToDatabase()
        {
            //Arrange
            var expectedNewPerson = new Person()
            {
                CategoryPersonId = 1,
                FirstName        = "Janek",
                LastName         = "Jankowski",
                PhoneNumber      = "789456159",
                Type             = PhoneNumberType.Mobile,
                Email            = "*****@*****.**"
            };
            PersonService personService = new PersonService(context);

            //Act
            var result = personService.AddContact(expectedNewPerson);

            //Assert
            Assert.NotNull(result);
        }
Пример #2
0
        public void UpdateContact_EditContactToDatabase_RecordUpdatedToDatabase()
        {
            //Arrange
            var expectedUpdatePerson = new Person()
            {
                CategoryPersonId = 1,
                FirstName        = "Antek",
                LastName         = "Nowak",
                PhoneNumber      = "5461235487",
                Type             = PhoneNumberType.Mobile,
                Email            = "*****@*****.**"
            };
            PersonService personService = new PersonService(context);

            //Act
            personService.AddContact(expectedUpdatePerson);
            expectedUpdatePerson.CategoryPersonId = 2;
            var result = personService.UpdateContact(expectedUpdatePerson);

            //Assert
            Assert.True(result);
        }