예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
        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);
        }
        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);
        }