Bind() public méthode

public Bind ( Type type, IBindingContext context ) : object
type System.Type
context IBindingContext
Résultat object
        public void bind_model_should_be_null_when_the_id_is_null()
        {
            using (var nested = container.GetNestedContainer())
            {
                var context = nested.GetInstance<IBindingContext>();
                var binder = new EntityModelBinder();

                binder.Bind(typeof (Site), context).ShouldBeOfType<Site>()
                    .Id.ShouldEqual(Guid.Empty);
            }
        }
        public void bind_model_should_return_the_correct_entity_if_the_Id_is_a_guid()
        {
            using (var nested = container.GetNestedContainer())
            {
                var site = new Site();
                nested.GetInstance<IRepository>().Save(site);
                requestData["Id"] = site.Id.ToString();

                var context = nested.GetInstance<IBindingContext>();
                var binder = new EntityModelBinder();

                binder.Bind(typeof (Site), context).ShouldBeOfType<Site>().Id.ShouldEqual(site.Id);
            }
        }