public async Task <IActionResult> List([FromQuery] ListProductItemFromQuery query)
        {
            var request = new ListProductItemRequest(query);

            var result = await _apiResult.Produce(request);

            return(result);
        }
        public void ConstructorShouldFailWhenQueryIsNull()
        {
            // Arrange
            ListProductItemFromQuery query = null;

            // Act
            Action ctor = () => { new ListProductItemRequest(query); };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
        public void ConstructorShouldSucceed()
        {
            // Arrange
            var query = new ListProductItemFromQuery();


            // Act
            var obj = new ListProductItemRequest(query);

            // Assert
            obj.Should().NotBeNull();
        }
        public void MemberQueryApiVersionShouldHaveCorrectValue()
        {
            // Arrange
            var apiVersion = "1.0";
            var query      = new ListProductItemFromQuery()
            {
                ApiVersion = apiVersion
            };

            // Act
            var obj = new ListProductItemRequest(query);

            // Assert
            obj.QueryApiVersion.Should().Be(apiVersion);
        }
Beispiel #5
0
 public ListProductItemRequest(ListProductItemFromQuery query)
 {
     _query = query ?? throw new ArgumentNullException(nameof(query));
 }