// GET: Format public ActionResult Index() { FormatList formats = new FormatList(); formats.Load(); return(View(formats)); }
public void LoadTest() { FormatList formats = new FormatList(); formats.Load(); int expected = 3; int actual = formats.Count; Assert.AreEqual(expected, actual); }
public void DeleteTest() { FormatList formats = new FormatList(); formats.Load(); //Find the format with the description testingformat Format format = formats.FirstOrDefault(f => f.Description == "UpdatedFormat"); //Delete it int result = format.Delete(); Assert.IsTrue(result == 1); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { formats = new FormatList(); formats.Load(); Reload(); //pretend someone clicked in the ddlFormats, send it with the sender and the e from this event ddlFormats_SelectedIndexChanged(sender, e); //Load data into the session Session["formats"] = formats; } else { //is a PostBack, kept in session, get the objects formats = (FormatList)Session["formats"]; } }
// GET: api/Format public IEnumerable <Format> Get() { formatList = new FormatList(); formatList.Load(); return(formatList); }