public void Create_Void_ReturnId() { var list = new List <DisciplineItem>() { _discipline }; Mock.Get(_disciplineRepository).Setup(x => x.Create(_discipline)).Returns(_discipline.Id); Mock.Get(_disciplineRepository).Setup(x => x.GetList()).Returns(list); var result = _disciplineService.Create(_discipline); Assert.AreEqual(result, _discipline.Id); }
static int AddScript3() { Discipline model = new Discipline() { Name = "Random Discipline" }; DateTime startTime = DateTime.Now; DisciplineService.Create(model); DateTime finishTime = DateTime.Now; return((int)(finishTime - startTime).TotalMilliseconds); }
public ActionResult Create(DisciplineItem discipline) { Access.CheckAccess("Discipline.Creator"); return(RedirectToAction("List", new { id = _disciplineService.Create(discipline) })); }