Example #1
0
        public async Task <IActionResult> Get([FromRoute] GetTeamFromRoute route,
                                              [FromQuery] GetTeamFromQuery query)
        {
            var request = new GetTeamRequest(route, query);
            var result  = await _apiResult.Produce(request);

            return(result);
        }
        public void ConstructorShouldFailWhenRequestIsNull()
        {
            // Arrange
            var route = new GetTeamFromRoute();
            GetTeamFromQuery query = null;

            // Act
            Action request = () => { new GetTeamRequest(route, query); };

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

            // Act
            var request = new GetTeamRequest(route, query);

            // Assert
            request.Should().NotBeNull();
        }
Example #4
0
 public GetTeamRequest(GetTeamFromRoute route,
                       GetTeamFromQuery query)
 {
     _route = route ?? throw new ArgumentNullException(nameof(route));
     _query = query ?? throw new ArgumentNullException(nameof(route));
 }