public void TestGetTutorById() { var mockUserSet = CreateMockUserSet(); mockUserSet.SetReturnsDefault(mockUserSet.Object.Cast <Tutor>()); _mockStudentExchangeDataContext.Setup(c => c.Users).Returns(mockUserSet.Object); var result = _tutorService.GeTutorById("testId2"); Assert.AreSame(_userSet.ToList().Find(u => u.Id == "testId2"), result); }
public IHttpActionResult Get(string tutorId) { return(Content(HttpStatusCode.OK, _tutorService.GeTutorById(tutorId))); }