public void adds_the_horizontal_form_class() { var request = new FormRequest(null, null); request.ReplaceTag(new FormTag("/test")); var modifier = new HorizontalFormModifier(); modifier.Modify(request); request.CurrentTag.HasClass("form-horizontal").ShouldBeTrue(); }
public void SetUp() { theServices = new InMemoryServiceLocator(); theSearch = ChainSearch.ByUniqueInputType(typeof (object)); theInput = new object(); theResolver = MockRepository.GenerateStub<IChainResolver>(); theUrlResolver = MockRepository.GenerateStub<IChainUrlResolver>(); theChain = new BehaviorChain(); theServices.Add(theResolver); theServices.Add(theUrlResolver); theRequest = new FormRequest(theSearch, theInput); }
public static ValidationOptions For(FormRequest request) { var services = request.Services; var type = services.GetInstance<ITypeResolver>().ResolveType(request.Input); var cache = services.GetInstance<ITypeDescriptorCache>(); var options = new ValidationOptions(); var node = request.Chain.ValidationNode() as IValidationNode; if (node == null) { return options; } // TODO -- Let's query the validation graph and register the rule alias/validation mode pairs here cache.ForEachProperty(type, property => { var accessor = new SingleProperty(property); fillFields(options, node, services, accessor); }); return options; }
public static ValidationOptions For(FormRequest request) { var services = request.Services; var type = services.GetInstance<ITypeResolver>().ResolveType(request.Input); var cache = services.GetInstance<ITypeDescriptorCache>(); var options = new ValidationOptions(); var node = request.Chain.ValidationNode(); if (node == null) { return options; } options._elementTimeout = node.ElementTimeout; cache.ForEachProperty(type, property => { var accessor = new SingleProperty(property); fillFields(options, node, services, accessor); }); return options; }
public static ValidationMode For(FormRequest request) { var validation = request.Chain.ValidationNode(); return validation == null ? None : validation.Mode; }
protected bool Equals(FormRequest other) { return(Equals(_search, other._search) && Equals(_input, other._input)); }
protected bool Equals(FormRequest other) { return Equals(_search, other._search) && Equals(_input, other._input); }
public void SetUp() { theRequest = new FormRequest(new ChainSearch {Type = typeof (object)}, new object()); var theForm = new FormTag("test"); theRequest.ReplaceTag(theForm); }
public void Modify(FormRequest request) { _modify(request); }