public void GetAllByConstructionId_ShouldReturnConstructionElements() { // Arrange int constructionId = _rnd.Next(1, _maxConstructionId); // Act var returnedConstructionElements = _service.GetAllByConstructionId( constructionId); // Assert Assert.Equal(_constructionElements.Where( v => v.Construction.Id == constructionId), returnedConstructionElements); }
public ActionResult <IEnumerable <ConstructionElementResponse> > GetAllByConstructionId( int constructionId) { var constructionElements = _service.GetAllByConstructionId(constructionId); return(Ok( _mapper.Map <IEnumerable <ConstructionElementResponse> >(constructionElements))); }