public void ShouldRetrieveNullIfStateIdDoesNotExist() { PostalInfoLookupDataSet ds = new PostalInfoLookupDataSet(); ds.States.AddStatesRow("CA", "California"); PostalInfoLookupService lookup = new PostalInfoLookupService(ds); State retrievedState = lookup.GetStateById("NA"); Assert.IsNull(retrievedState); }
public void ShouldRetrieveStateById() { PostalInfoLookupDataSet ds = new PostalInfoLookupDataSet(); ds.States.AddStatesRow("CA", "California"); ds.States.AddStatesRow("OR", "Oregon"); PostalInfoLookupService lookup = new PostalInfoLookupService(ds); State retrievedState = lookup.GetStateById("OR"); Assert.IsNotNull(retrievedState); Assert.AreEqual("Oregon", retrievedState.Name); }