Esempio n. 1
0
        public void CanBind_Primitive()
        {
            var context = Substitute.For <IModelBinderContext>();

            context.ModelType.Returns(typeof(int));
            var binder = new ArrayModelBinder();

            Assert.False(binder.CanBind(context));
        }
Esempio n. 2
0
        public void CanBind_List()
        {
            var context = Substitute.For <IModelBinderContext>();

            context.ModelType.Returns(typeof(IEnumerable <int>));
            var binder = new ArrayModelBinder();

            Assert.False(binder.CanBind(context));
        }
Esempio n. 3
0
        public void CanBind_IntArray()
        {
            var context = Substitute.For <IModelBinderContext>();

            context.ModelType.Returns(typeof(int[]));
            var binder = new ArrayModelBinder();

            Assert.True(binder.CanBind(context));
        }