public void GetById_WhenIdIsLessThanZero_ShouldReturnError()
        {
            var repository = Mock.Create<IRepository<Student>>();

            var controller = new StudentsController(repository);
            SetupController(controller);
            
            var response = controller.GetById(-2);
            
            Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode);
        }
        public void GetById_WhenIdMatching_ShouldReturnAppropriateElement()
        {
            var repository = Mock.Create<IRepository<Student>>();
            var firstStudentToAdd = new Student()
            {
                // Deliberate setting so that the appropriate id can be returned in the 
                // controller.
                Id = 32,
                LastName = "First test student"
            };

          
            Mock.Arrange(() => repository.GetById(Arg.Is(1))).Returns(() => firstStudentToAdd);

            var controller = new StudentsController(repository);
            SetupController(controller);

            var response = controller.GetById(1);
            StudentModel student = new StudentModel();
            bool gotValue = response.TryGetContentValue(out student);

            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
            Assert.IsTrue(gotValue);
            Assert.AreEqual(32, student.Id);
        }