public void set_a_property_correctly_against_a_binding_context()
        {
            var model = new AddressViewModel();
            context.WithData("Localities[0]ZipCode", "84115");
            context.StartObject(model);

            var property = ReflectionHelper.GetProperty<AddressViewModel>(x => x.Localities);
            propertyBinder.Bind(property, context);

            model.Localities[0].ZipCode.ShouldEqual("84115");
        }
示例#2
0
        public void store_and_retrieve_objects()
        {
            var address = new Address();
            var model = new AddressViewModel();

            var session = new BasicSessionState();
            session.Set(address);
            session.Set(model);

            session.Get<Address>().ShouldBeTheSameAs(address);
            session.Get<AddressViewModel>().ShouldBeTheSameAs(model);
        }