Example #1
0
        public void GeoNames_Results_ShouldBePublic()
        {
            var model = new NearbyPostalCodeResults
            {
                Items = new List <NearbyPostalCode>
                {
                    new NearbyPostalCode(), new NearbyPostalCode(), new NearbyPostalCode(),
                },
            };

            model.ShouldNotBeNull();
            model.Items.ShouldNotBeNull();
            model.Items.Count.ShouldEqual(3);
        }
Example #2
0
        public void GeoNames_Results_ShouldImplementGenericIEnumerable()
        {
            var model = new NearbyPostalCodeResults
            {
                Items = new List <NearbyPostalCode>
                {
                    new NearbyPostalCode(), new NearbyPostalCode(), new NearbyPostalCode(),
                },
            };

            model.ShouldImplement(typeof(IEnumerable <object>));
            model.GetEnumerator().ShouldNotBeNull();
            ((IEnumerable)model).GetEnumerator().ShouldNotBeNull();
            foreach (var item in model)
            {
                item.ShouldNotBeNull();
            }
        }