Пример #1
0
        public void GetAreaName_InvalidAreaCode_ReturnsEmptyString()
        {
            string       areaCode             = "123456";
            PhoneNumbers phoneNumberConverter = new PhoneNumbers();
            string       actual = phoneNumberConverter.GetAreaName(areaCode);

            Assert.IsEmpty(actual);
        }
Пример #2
0
        public void GetAreaName_EmptyAreaCode_ReturnsEmptyString()
        {
            string       areaCode             = String.Empty;
            PhoneNumbers phoneNumberConverter = new PhoneNumbers();
            string       actual = phoneNumberConverter.GetAreaName(areaCode);

            Assert.IsEmpty(actual);
        }
Пример #3
0
        public void GetAreaName_AreaCodeOfTMobileGermany_ReturnsTMobile()
        {
            MockRepository           mocks                = new MockRepository();
            IPhoneNumberDataXml      xmlDataProvider      = mocks.Stub <IPhoneNumberDataXml>();
            IPhoneNumberDataRegistry registryDataProvider = mocks.Stub <IPhoneNumberDataRegistry>();

            string areaCode = "+491511";
            string expected = "T-Mobile (D1)";

            using (mocks.Record())
            {
                xmlDataProvider.GetCarrierName("+491511");
                LastCall.Return("T-Mobile (D1)");
            }

            PhoneNumbers phoneNumberConverter = new PhoneNumbers(xmlDataProvider, registryDataProvider);
            string       actual = phoneNumberConverter.GetAreaName(areaCode);

            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void GetAreaName_AreaCodeOfDresdenGermany_ReturnsDresden()
        {
            MockRepository           mocks                = new MockRepository();
            IPhoneNumberDataXml      xmlDataProvider      = mocks.Stub <IPhoneNumberDataXml>();
            IPhoneNumberDataRegistry registryDataProvider = mocks.Stub <IPhoneNumberDataRegistry>();

            string areaCode = "+49351";
            string expected = "Dresden";

            using (mocks.Record())
            {
                xmlDataProvider.GetCityName("+49351");
                LastCall.Return("Dresden");
            }

            PhoneNumbers phoneNumberConverter = new PhoneNumbers(xmlDataProvider, registryDataProvider);
            string       actual = phoneNumberConverter.GetAreaName(areaCode);

            Assert.AreEqual(expected, actual);
        }
Пример #5
0
        public void GetAreaName_InvalidAreaCode_ReturnsEmptyString()
        {
            string areaCode = "123456";
            PhoneNumbers phoneNumberConverter = new PhoneNumbers();
            string actual = phoneNumberConverter.GetAreaName(areaCode);

            Assert.IsEmpty(actual);
        }
Пример #6
0
        public void GetAreaName_EmptyAreaCode_ReturnsEmptyString()
        {
            string areaCode = String.Empty;
            PhoneNumbers phoneNumberConverter = new PhoneNumbers();
            string actual = phoneNumberConverter.GetAreaName(areaCode);

            Assert.IsEmpty(actual);
        }
Пример #7
0
        public void GetAreaName_AreaCodeOfTMobileGermany_ReturnsTMobile()
        {
            MockRepository mocks = new MockRepository();
            IPhoneNumberDataXml xmlDataProvider = mocks.Stub<IPhoneNumberDataXml>();
            IPhoneNumberDataRegistry registryDataProvider = mocks.Stub<IPhoneNumberDataRegistry>();

            string areaCode = "+491511";
            string expected = "T-Mobile (D1)";

            using (mocks.Record())
            {
                xmlDataProvider.GetCarrierName("+491511");
                LastCall.Return("T-Mobile (D1)");
            }

            PhoneNumbers phoneNumberConverter = new PhoneNumbers(xmlDataProvider, registryDataProvider);
            string actual = phoneNumberConverter.GetAreaName(areaCode);

            Assert.AreEqual(expected, actual);
        }
Пример #8
0
        public void GetAreaName_AreaCodeOfDresdenGermany_ReturnsDresden()
        {
            MockRepository mocks = new MockRepository();
            IPhoneNumberDataXml xmlDataProvider = mocks.Stub<IPhoneNumberDataXml>();
            IPhoneNumberDataRegistry registryDataProvider = mocks.Stub<IPhoneNumberDataRegistry>();

            string areaCode = "+49351";
            string expected = "Dresden";

            using (mocks.Record())
            {
                xmlDataProvider.GetCityName("+49351");
                LastCall.Return("Dresden");
            }

            PhoneNumbers phoneNumberConverter = new PhoneNumbers(xmlDataProvider, registryDataProvider);
            string actual = phoneNumberConverter.GetAreaName(areaCode);

            Assert.AreEqual(expected, actual);
        }