Ejemplo n.º 1
0
        public async Task <IActionResult> List([FromQuery] ListOperatorFromQuery query)
        {
            var request = new ListOperatorRequest(query);
            var result  = await _apiResult.Produce(request);

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

            // Act
            Action request = () => { new ListOperatorRequest(query); };

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

            // Act
            var request = new ListOperatorRequest(query);

            // Assert
            request.Should().NotBeNull();
        }
Ejemplo n.º 4
0
 public ListOperatorRequest(ListOperatorFromQuery query)
 {
     _query = query ?? throw new ArgumentNullException(nameof(query));
 }