コード例 #1
0
        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);
        }
コード例 #2
0
        public ActionResult <IEnumerable <ConstructionElementResponse> > GetAllByConstructionId(
            int constructionId)
        {
            var constructionElements = _service.GetAllByConstructionId(constructionId);

            return(Ok(
                       _mapper.Map <IEnumerable <ConstructionElementResponse> >(constructionElements)));
        }