コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Flamenrage/Lab5scdb
        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);
        }
コード例 #3
0
 public ActionResult Create(DisciplineItem discipline)
 {
     Access.CheckAccess("Discipline.Creator");
     return(RedirectToAction("List", new { id = _disciplineService.Create(discipline) }));
 }