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(); }
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(); }
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(); }