public void CanDeserializeFromParams() { var attr = new DeserializeAttribute("ids", RequestStore.Params); var ids = (int[])attr.BindModel(_controllerContext, CreateContext(typeof(int[]))); Assert.IsNotNull(ids); Assert.AreEqual(4, ids.Length); }
public void CanCreateAttribute() { var attr = new DeserializeAttribute("ids", RequestStore.Params); }
public void GetBinder_ReturnsInstanceOfDeserializeAttribute() { var binder = new DeserializeAttribute("ids", RequestStore.All); var modelBinder = binder.GetBinder(); Assert.IsNotNull(modelBinder); Assert.AreEqual(modelBinder, binder); }
public void Duplicates_Create_CSV_In_QString_Form_Cookies_SvrVars_TempData_RouteData_Order() { var attr = new DeserializeAttribute("dupe", RequestStore.All); var dupe = (string[])attr.BindModel(_controllerContext,CreateContext(typeof(string[]))); Assert.IsNotNull(dupe); Assert.AreEqual("1,2,3,4,5,6", dupe[0]); }
public void ForCompletenessNoPrefix() { var attribute = new DeserializeAttribute(); Assert.IsNull(attribute.Prefix); }
public void ForCompleteness() { var attribute = new DeserializeAttribute("test"); Assert.AreEqual("test", attribute.Prefix); }