Ejemplo n.º 1
0
        public async Task ShouldDeleteOnePhoneRecord()
        {
            int entityID    = 1;
            var phoneNumber = "697-555-0142";
            var phoneTypeID = 1;

            var phone = await _phoneRepo.GetPhoneByID(entityID, phoneNumber, phoneTypeID);

            Assert.NotNull(phone);

            await _phoneRepo.DeletePhone(phone);

            var result = await _phoneRepo.GetPhoneByID(entityID, phoneNumber, phoneTypeID);

            Assert.Null(result);
        }
        public async Task ShouldCreateOnePhoneRecord()
        {
            var phone = new PersonPhone
            {
                BusinessEntityID  = 9,
                PhoneNumber       = "816-555-9999",
                PhoneNumberTypeID = 2
            };

            await _phoneRepo.CreatePhone(phone);

            var result = await _phoneRepo.GetPhoneByID(phone.BusinessEntityID, phone.PhoneNumber, phone.PhoneNumberTypeID);

            Assert.Equal(phone.BusinessEntityID, result.BusinessEntityID);
            Assert.Equal(phone.PhoneNumber, result.PhoneNumber);
            Assert.Equal(phone.PhoneNumberTypeID, result.PhoneNumberTypeID);
        }
Ejemplo n.º 3
0
        public async Task ShouldGetOnePhoneRecordByPrimaryKeys(int entityID, string phoneNumber, int phoneTypeID)
        {
            var phone = await _phoneRepo.GetPhoneByID(entityID, phoneNumber, phoneTypeID);

            Assert.NotNull(phone);
        }