public void GetAllByUserAndSectionId_ShouldReturnuserGeneralDataPoints() { // Arrange int userId = _rnd.Next(1, _maxUserId); int sectionId = _rnd.Next(1, TestData.generalDataSections.Count()); // Act var returnedGeneralDataPoints = _service.GetAllByUserAndSectionId(userId, sectionId); // Assert Assert.Equal(_generalDataPoints.Where( v => v.User.Id == userId && v.Section.Id == sectionId), returnedGeneralDataPoints); }
public ActionResult <IEnumerable <GeneralDataPointResponse> > GetAllByUserAndSectionId( int userId, int sectionId) { var points = _service.GetAllByUserAndSectionId(userId, sectionId); return(Ok(_mapper.Map <IEnumerable <GeneralDataPointResponse> >(points))); }