public static bool ConvertAllToUpper(ref FormCollection collection) { try { for (int index = 0; index < collection.Count; index++) collection.Set(collection.GetKey(index), collection.Get(index).ToString().ToUpper()); return true; } catch { return false; } }
public void Post_Index() { var form = new FormCollection(); form.Set("payment_method", "PayPal"); var result = _controller.Index(form) as RedirectToRouteResult; Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult)); Assert.AreEqual("PayWithPayPal", result.RouteValues["action"]); }