public void OnlyAppliesToType_ICookieStorage()
        {
            var binder = new CookieStoragePropertyBinder();
            var model = new CookieRequestModel();

            binder.Matches(model.GetType().GetProperty("Cookies")).ShouldBeTrue();
            binder.Matches(model.GetType().GetProperty("NotCookies")).ShouldBeFalse();
        }
        public void SetsPropertyFromContextOnModel()
        {
            var binder = new CookieStoragePropertyBinder();
            var model = new CookieRequestModel();
            var context = new Mock<IBindingContext>();
            var cookies = new CookieStorage(new Mock<HttpContextBase>().Object);

            context.Setup(x => x.Service<ICookieStorage>()).Returns(cookies);
            context.SetupGet(x => x.Object).Returns(model);

            binder.Bind(model.GetType().GetProperty("Cookies"), context.Object);

            model.Cookies.ShouldEqual(cookies);
        }