public void CheckZip() { foreach (Type type in list) { //Create an instance of an object that implements the Interface IListElectedCongress testTypeInstance = (IListElectedCongress)Activator.CreateInstance(type); //Set the API Code here (you know the one for Bing Maps) testTypeInstance.SetApiCode("PUT YOUR API CODE HERE"); Assert.IsTrue(testTypeInstance.GetRepresentativesByZip("37353") == null); Assert.IsTrue(testTypeInstance.GetRepresentativesByZip("37315") != null); } }
public void CheckSenZip() { foreach (Type type in list) { //Create an instance of an object that implements the Interface IListElectedCongress testTypeInstance = (IListElectedCongress)Activator.CreateInstance(type); //Set the API Code here (you know the one for Bing Maps) testTypeInstance.SetApiCode("Aq9kZuBvs2QT_YQeG5kYXejUqD0rLAsQkjgqZJzbIyANUGZbquKQ4xF02cHByqMk"); var collegedale = testTypeInstance.GetSenator("TN"); Assert.IsTrue(testTypeInstance.GetRepresentativesByZip("37353") != null); Assert.IsTrue(testTypeInstance.GetRepresentativesByZip("37315") != null); Assert.IsTrue(collegedale[0].bioguide_id.Equals("A000360")); } }
public void CheckZip() { foreach (Type type in list) { //Create an instance of an object that implements the Interface IListElectedCongress testTypeInstance = (IListElectedCongress)Activator.CreateInstance(type); //Set the API Code here (you know the one for Bing Maps) testTypeInstance.SetApiCode("Aq9kZuBvs2QT_YQeG5kYXejUqD0rLAsQkjgqZJzbIyANUGZbquKQ4xF02cHByqMk"); //This test was initially == null... But GetRepByZip should never return null... those are valid Zip codes. So I changed the test to != null! //37353 is Mc Donald in Bradley county //37315 is Collegedale in Hamilton county Assert.IsTrue(testTypeInstance.GetRepresentativesByZip("37353") != null); Assert.IsTrue(testTypeInstance.GetRepresentativesByZip("37315") != null); } }