Example #1
0
        public ActionResult <IEnumerable <SpecificationResponse> > GetAllByMarkId(
            int markId)
        {
            var specifications = _service.GetAllByMarkId(markId);

            return(Ok(_mapper.Map <IEnumerable <SpecificationResponse> >(
                          specifications)));
        }
        public void GetAllByMarkId_ShouldReturnSpecifications()
        {
            // Arrange
            int markId = _rnd.Next(1, _maxMarkId);

            // Act
            var returnedSpecifications = _service.GetAllByMarkId(markId);

            // Assert
            Assert.Equal(_specifications.Where(
                             v => v.Mark.Id == markId), returnedSpecifications);
        }