コード例 #1
0
        public void CreateNewContactNumberForNoneExistentContactOnContactNumberService()
        {
            //arrange
            var contactNumberToCreate = new ContactNumber
            {
                ContactId       = new Guid("720d966c-5685-45c2-b63d-1312620e1d11"),
                Description     = "Work",
                TelephoneNumber = "297724563901"
            };

            ContactNumberService contactNumberService = new ContactNumberService(MockUnitOfWork.Object);

            //act
            Guid contactNumberId = contactNumberService.Create(contactNumberToCreate);

            //assert

            contactNumberService.Dispose();
        }
コード例 #2
0
        public void CreateNewContactOnContactNumberService()
        {
            //arrange
            var contactNumberToCreate = new ContactNumber {
                ContactId = new Guid("81c4763c-b225-4756-903a-750064167813"), Description = "Work", TelephoneNumber = "201803896534"
            };

            ContactNumberService contactNumberService = new ContactNumberService(MockUnitOfWork.Object);

            //act
            Guid contactNumberId = contactNumberService.Create(contactNumberToCreate);

            //assert
            MockContactNumberRepository.Verify(y => y.Create(It.IsAny <ContactNumber>()));
            Assert.IsNotNull(contactNumberId);
            Assert.AreEqual(contactNumberId, contactNumberToCreate.Id);

            contactNumberService.Dispose();
        }
コード例 #3
0
        public void CreateContactNumberForContactWithTelephoneNumberOfExistingContactNumberOnContactNumberService()
        {
            //arrange
            ContactNumber contactNumberToCreate = new ContactNumber
            {
                ContactId       = new Guid("81c4763c-b225-4756-903a-750064167813"),
                Description     = "Work",
                TelephoneNumber = "297724563901"
            };

            ContactNumberService contactNumberService = new ContactNumberService(MockUnitOfWork.Object);

            //act
            contactNumberService.Create(contactNumberToCreate);

            //assert - expect excpetion

            contactNumberService.Dispose();
        }