public ActionResult New() { List <Sprint> allSprints = SprintService.GetAllSprints(_ScrumTimeEntities, SessionHelper.GetCurrentProductId(User.Identity.Name, Session)); Sprint noneSprint = new Sprint() { Name = "None", SprintId = -1 }; allSprints.Insert(0, noneSprint); int currentProductId = SessionHelper.GetCurrentProductId(User.Identity.Name, Session); Product product = _ScrumTimeEntities.Products.First <Product>(p => p.ProductId == currentProductId); StoryViewModel storyViewModel = new StoryViewModel() { StoryModel = new Story() { StoryId = 0, Narrative = "As a ...", Points = 0, Priority = 0, UserDefinedId = (product.Stories.Count() + 1).ToString() }, AllSprints = allSprints }; return(PartialView("Edit", storyViewModel)); }
public void GetSprintsTest() { var mock = new Mock <IUnitOfWork>(); mock.Setup(i => i.SprintRepository.GetAll()).Returns(new List <SprintDAL>().AsQueryable()); SprintService service = new SprintService(mock.Object); var result = service.GetAllSprints(); Assert.IsAssignableFrom <IQueryable <SprintDTO> >(result); }
public ActionResult Edit(int id) { List <Sprint> allSprints = SprintService.GetAllSprints(_ScrumTimeEntities, SessionHelper.GetCurrentProductId(User.Identity.Name, Session)); Sprint noneSprint = new Sprint() { Name = "None", SprintId = -1 }; allSprints.Insert(0, noneSprint); Story story = _StoryService.GetStoryById(id); StoryViewModel storyViewModel = new StoryViewModel() { StoryModel = story, AllSprints = allSprints }; return(PartialView(storyViewModel)); }