public void GetAreaName_InvalidAreaCode_ReturnsEmptyString() { string areaCode = "123456"; PhoneNumbers phoneNumberConverter = new PhoneNumbers(); string actual = phoneNumberConverter.GetAreaName(areaCode); Assert.IsEmpty(actual); }
public void GetAreaName_EmptyAreaCode_ReturnsEmptyString() { string areaCode = String.Empty; PhoneNumbers phoneNumberConverter = new PhoneNumbers(); string actual = phoneNumberConverter.GetAreaName(areaCode); Assert.IsEmpty(actual); }
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); }
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); }
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); }
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); }