Ejemplo n.º 1
0
        public void GetById_WhereIdExists_ReturnsInstructorWithThatId([Values(1, 2, 3)] int idToRetrieve)
        {
            //Arrange
            Mock.Arrange(() => _instructorService.Get(idToRetrieve)).Returns(_mockInstructorList.First(x => x.InstructorId == idToRetrieve)).OccursOnce();

            var expected = _mockInstructorList.First(x => x.InstructorId == idToRetrieve);

            var instructorController = new InstructorController(_instructorService);

            ////Act
            var actual        = instructorController.Get(idToRetrieve) as OkNegotiatedContentResult <InstructorDto>;
            var actualContent = actual.Content;

            //Assert
            Mock.Assert(_instructorService);
            Assert.That(actualContent, Is.EqualTo(expected));
        }
        public ActionResult EgitmenProfili(InstructorClass ınstructor)
        {
            UserClass user = Session["Kullanici"] as UserClass;


            var i = _instructorService.Get(ınstructor.ID);

            return(View("EgitmenProfili", i));
        }
Ejemplo n.º 3
0
        public IHttpActionResult Get(int id)
        {
            InstructorDto instructor;

            using (_instructorService)
            {
                instructor = _instructorService.Get(id);
            }
            return(Ok(instructor));
        }
Ejemplo n.º 4
0
 public IQueryable <InstructorViewModel> Read()
 {
     return(_instructorService.Get());
 }