public void Init() { var en = CultureInfo.CreateSpecificCulture("en"); Thread.CurrentThread.CurrentCulture = en; Thread.CurrentThread.CurrentUICulture = en; helper = new FormHelper(); subscription = new Subscription(); mock = new MockClass(); months = new[] {new Month(1, "January"), new Month(1, "February")}; product = new Product("memory card", 10, (decimal) 12.30); user = new SimpleUser(); users = new[] { new SimpleUser(1, false), new SimpleUser(2, true), new SimpleUser(3, false), new SimpleUser(4, true) }; mock.Values = new[] { 2, 3 }; var controller = new HomeController(); var context = new ControllerContext(); context.PropertyBag.Add("product", product); context.PropertyBag.Add("user", user); context.PropertyBag.Add("users", users); context.PropertyBag.Add("roles", new[] { new Role(1, "a"), new Role(2, "b"), new Role(3, "c") }); context.PropertyBag.Add("sendemail", true); context.PropertyBag.Add("confirmation", "abc"); context.PropertyBag.Add("fileaccess", FileAccess.Read); context.PropertyBag.Add("subscription", subscription); context.PropertyBag.Add("months", months); context.PropertyBag.Add("mock", mock); helper.SetController(controller, context); }
public void Init() { CultureInfo en = CultureInfo.CreateSpecificCulture("en"); Thread.CurrentThread.CurrentCulture = en; Thread.CurrentThread.CurrentUICulture = en; helper = new FormHelper(); model = new ModelWithValidation(); HomeController controller = new HomeController(); PrepareController(controller, "", "Home", "Index"); controller.PropertyBag.Add("model", model); helper.SetController(controller); }
public void Init() { CultureInfo en = CultureInfo.CreateSpecificCulture("en"); Thread.CurrentThread.CurrentCulture = en; Thread.CurrentThread.CurrentUICulture = en; helper = new FormHelper(); subscription = new Subscription(); months = new Month[] {new Month(1, "January"), new Month(1, "February")}; product = new Product("memory card", 10, (decimal) 12.30); user = new SimpleUser(); contact = new Contact(); HomeController controller = new HomeController(); ControllerContext context = new ControllerContext(); context.PropertyBag.Add("product", product); context.PropertyBag.Add("user", user); context.PropertyBag.Add("roles", new Role[] { new Role(1, "a"), new Role(2, "b"), new Role(3, "c") }); context.PropertyBag.Add("sendemail", true); context.PropertyBag.Add("confirmation", "abc"); context.PropertyBag.Add("fileaccess", FileAccess.Read); context.PropertyBag.Add("subscription", subscription); context.PropertyBag.Add("months", months); context.PropertyBag.Add("contact", contact); workTable = new DataTable("Customers"); DataColumn workCol = workTable.Columns.Add("CustID", typeof(Int32)); workCol.AllowDBNull = false; workCol.Unique = true; workTable.Columns.Add("Name", typeof(String)); DataRow row = workTable.NewRow(); row[0] = 1; row[1] = "chris rocks"; workTable.Rows.Add(row); row = workTable.NewRow(); row[0] = 2; row[1] = "will ferrell"; workTable.Rows.Add(row); helper.SetController(controller, context); }