コード例 #1
0
 public void build_passes_through()
 {
     var binder = new PassthroughConverter<HttpPostedFileBase>();
     var context = MockRepository.GenerateMock<IPropertyContext>();
     context.Expect(c => c.PropertyValue).Return(new object());
     ValueConverter converter = binder.Build(MockRepository.GenerateStub<IValueConverterRegistry>(), property(x => x.File));
     converter.Convert(context);
     context.VerifyAllExpectations();
 }
コード例 #2
0
        public void build_passes_through()
        {
            var             binder  = new PassthroughConverter <HttpPostedFileBase>();
            IBindingContext context = MockRepository.GenerateMock <IBindingContext>();

            context.Expect(c => c.PropertyValue).Return(new object());
            ValueConverter converter = binder.Build(MockRepository.GenerateStub <IValueConverterRegistry>(), property(x => x.File));

            converter(context);
            context.VerifyAllExpectations();
        }
コード例 #3
0
        public void build_passes_through()
        {
            var binder  = new PassthroughConverter <HttpPostedFileBase>();
            var context = MockRepository.GenerateMock <IPropertyContext>();

            context.Expect(c => c.RawValueFromRequest).Return(new BindingValue()
            {
                RawValue = new object()
            });
            ValueConverter converter = binder.Build(MockRepository.GenerateStub <IValueConverterRegistry>(), property(x => x.File));

            converter.Convert(context);
            context.VerifyAllExpectations();
        }