public async Task <IActionResult> Delete([FromRoute] DeleteWorkOrderFromRoute route,
                                                 [FromQuery] DeleteWorkOrderFromQuery query,
                                                 [FromHeader] DeleteWorkOrderFromHeader header)
        {
            var request = new DeleteWorkOrderRequest(route, query, header);

            var result = await _apiResult.Produce(request);

            return(result);
        }
        public void ConstructorShouldFailWhenHeaderIsNull()
        {
            // Arrange
            var route = new DeleteWorkOrderFromRoute();
            var query = new DeleteWorkOrderFromQuery();
            DeleteWorkOrderFromHeader header = null;

            // Act
            Action ctor = () => { new DeleteWorkOrderRequest(route, query, header); };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
        public void ConstructorShouldSucceed()
        {
            // Arrange
            var route  = new DeleteWorkOrderFromRoute();
            var query  = new DeleteWorkOrderFromQuery();
            var header = new DeleteWorkOrderFromHeader();


            // Act
            var obj = new DeleteWorkOrderRequest(route, query, header);

            // Assert
            obj.Should().NotBeNull();
        }
        public void MemberQueryApiVersionShouldHaveCorrectValue()
        {
            // Arrange
            var apiVersion = "1.0";
            var route      = new DeleteWorkOrderFromRoute();
            var query      = new DeleteWorkOrderFromQuery()
            {
                ApiVersion = apiVersion
            };
            var header = new DeleteWorkOrderFromHeader();

            // Act
            var obj = new DeleteWorkOrderRequest(route, query, header);

            // Assert
            obj.QueryApiVersion.Should().Be(apiVersion);
        }
        public void MemberRouteIdShouldHaveCorrectValue()
        {
            // Arrange
            var routeId = Guid.NewGuid().ToString();
            var route   = new DeleteWorkOrderFromRoute()
            {
                Id = routeId
            };
            var query  = new DeleteWorkOrderFromQuery();
            var header = new DeleteWorkOrderFromHeader();

            // Act
            var obj = new DeleteWorkOrderRequest(route, query, header);

            // Assert
            obj.RouteId.Should().Be(routeId);
        }
        public void MemberHeaderIfMatchShouldHaveCorrectValue()
        {
            // Arrange
            var ifMatch = "287687687";
            var route   = new DeleteWorkOrderFromRoute();
            var query   = new DeleteWorkOrderFromQuery();
            var header  = new DeleteWorkOrderFromHeader()
            {
                IfMatch = ifMatch
            };

            // Act
            var obj = new DeleteWorkOrderRequest(route, query, header);

            // Assert
            obj.HeaderIfMatch.Should().Be(ifMatch);
        }
 public DeleteWorkOrderRequest(DeleteWorkOrderFromRoute route, DeleteWorkOrderFromQuery query, DeleteWorkOrderFromHeader header)
 {
     _route  = route ?? throw new ArgumentNullException(nameof(route));
     _query  = query ?? throw new ArgumentNullException(nameof(query));
     _header = header ?? throw new ArgumentNullException(nameof(header));
 }