コード例 #1
0
 public RequestModelBinder(
     IRequestMetaDeserializer requestSerializer,
     RequestSchemaVersionAccessor requestVersionAccessor)
 {
     this.requestSerializer            = requestSerializer;
     this.requestSchemaVersionAccessor = requestVersionAccessor;
 }
コード例 #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(PublishSchemeRequest));
            this.context.ModelState    = new ModelStateDictionary();
            this.context.BindingSource = BindingSource.Body;

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