Exemplo n.º 1
0
 public DeleteTeamRequest(DeleteTeamFromRoute route,
                          DeleteTeamFromQuery query,
                          DeleteTeamFromHeader header)
 {
     _route  = route ?? throw new ArgumentNullException(nameof(route));
     _query  = query ?? throw new ArgumentNullException(nameof(query));
     _header = header ?? throw new ArgumentNullException(nameof(header));
 }
Exemplo n.º 2
0
        public async Task <IActionResult> Delete([FromRoute] DeleteTeamFromRoute route,
                                                 [FromQuery] DeleteTeamFromQuery query,
                                                 [FromHeader] DeleteTeamFromHeader header)
        {
            var request = new DeleteTeamRequest(route, query, header);
            var result  = await _apiResult.Produce(request);

            return(result);
        }
        public void ConstructorShouldFailWhenHeaderIsNull()
        {
            // Arrange
            var route = new DeleteTeamFromRoute();
            var query = new DeleteTeamFromQuery();
            DeleteTeamFromHeader header = null;

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

            // Assert
            request.Should().Throw <ArgumentNullException>();
        }
        public void ConstructorShouldSucceed()
        {
            // Arrange
            var route  = new DeleteTeamFromRoute();
            var query  = new DeleteTeamFromQuery();
            var header = new DeleteTeamFromHeader();

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

            // Assert
            request.Should().NotBeNull();
        }