// --------------------------------------------------------[] public ActionResult AddTask() { using( var model = new DemoshopModel() ) { model.CreateEbaySubmissionTask(); model.Message = "Task added"; } return RedirectToAction( "Index" ); }
public void IndexTest() { var message = ""; using( var m = new DemoshopModel() ) { m.DeleteTasks(); m.CreateEbaySubmissionTask(); m.Message = ( message = "Task [{0}] added".SafeFormat( m.StoreTasks.First().Id ) ); } var model = new DemoshopModel(); Console.WriteLine( message ); Assert.AreEqual( 1, model.StoreTasks.Count(), "StoreTasks.Count" ); Assert.AreEqual( message, model.Message, "Message" ); ShowTasks( model.StoreTasks ); }