public RequestModelBinder(
     IRequestMetaDeserializer requestSerializer,
     RequestSchemaVersionAccessor requestVersionAccessor)
 {
     this.requestSerializer            = requestSerializer;
     this.requestSchemaVersionAccessor = requestVersionAccessor;
 }
Beispiel #2
0
        public RequestModelBinderSpec()
        {
            this.requestMetaDeserializer = Substitute.For <IRequestMetaDeserializer>();
            this.versionAccessor         = Substitute.For <RequestSchemaVersionAccessor>();
            this.modelBinder             = new RequestModelBinder(this.requestMetaDeserializer, this.versionAccessor);
            this.context = Substitute.For <ModelBindingContext>();

            this.context.ModelType.Returns(typeof(AddLikeRequest));
            this.context.ModelState    = new ModelStateDictionary();
            this.context.BindingSource = BindingSource.Body;

            this.versionAccessor.GetSchemaVersion(this.context).Returns(this.testSchemaVersion);
        }