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();
 }
        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();
        }
        public void detects_BindingValue_and_returns_inner_value()
        {
            var testValue = "testValue";
            var binder    = new PassthroughConverter <HttpPostedFileBase>();
            var context   = MockRepository.GenerateMock <IPropertyContext>();

            context.Stub(c => c.RawValueFromRequest).Return(new BindingValue()
            {
                RawValue = testValue
            });
            binder.Convert(context).ShouldBeTheSameAs(testValue);
        }
        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();
        }
 public void matches_by_property_type_positive()
 {
     var binder = new PassthroughConverter<HttpPostedFileBase>();
     binder.Matches(property(x => x.File)).ShouldBeTrue();
 }
 public void matches_by_object_property_type_negative()
 {
     var binder = new PassthroughConverter<HttpPostedFileBase>();
     binder.Matches(property(x => x.File3)).ShouldBeFalse();
 }
        public void matches_by_property_type_negative()
        {
            var binder = new PassthroughConverter <HttpPostedFileBase>();

            binder.Matches(property(x => x.File2)).ShouldBeFalse();
        }