コード例 #1
0
        public void EditAluno_ShouldReturnStatusCode()
        {
            var controller = new AlunosController(new TestUniversityContext());

            var item = GetDemoAluno();

            var result = controller.Edit(item.ID);
            Assert.IsNotNull(result);
        }
コード例 #2
0
        public void GetAluno_ShouldReturnAlunoWithSameID()
        {
            var context = new TestUniversityContext();
            context.Alunos.Add(GetDemoAluno());

            var controller = new AlunosController(context);
            var result = controller.Edit(3) as ViewResult;

            Assert.IsNotNull(result);
        }
コード例 #3
0
        public void CreateAluno_ShouldReturnSameAluno()
        {
            var controller = new AlunosController(new TestUniversityContext());

            var item = GetDemoAluno();

            var result = controller.Create(item);

            Assert.IsNotNull(result);
        }
コード例 #4
0
        public void DeleteAluno_ShouldReturnOK()
        {
            var context = new TestUniversityContext();
            var item = GetDemoAluno();
            context.Alunos.Add(item);

            var controller = new AlunosController(context);
            var result = controller.Delete(3);

            Assert.IsNotNull(result);
        }