Exemplo n.º 1
0
        public void Week_Fetch_Info_List()
        {
            WeekTestHelper.WeekAdd();
            WeekTestHelper.WeekAdd();

            var weeks = WeekRepository.WeekFetchInfoList(new WeekDataCriteria());

            Assert.IsTrue(weeks.Count() > 1, "Row returned should be greater than one");
        }
Exemplo n.º 2
0
        public ActionResult Index(int?year)
        {
            var model = new WeekListModel();
            var weeks = WeekRepository.WeekFetchInfoList(new WeekDataCriteria());

            model.Weeks = weeks.Where(row => year == null || row.Year == year.Value);
            model.Years = weeks.Select(row => row.Year).Distinct();
            model.Actions.Add("Add weeks", Url.Action("Create"), "primary");

            return(this.View(model));
        }