示例#1
0
 public bool Equals(FindItemRequest <TEntity> other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other.Id.Equals(Id));
 }
示例#2
0
            public void Should_Throw_On_Null_Or_Empty_Request_Parameter()
            {
                //Given
                ICakeContext           context  = _Context;
                SsrsConnectionSettings settings = _Settings;
                FindItemRequest        request  = null;


                //When
                var record = Record.Exception(() => SsrsAliases.SsrsFindItem(context, request, settings));

                //Then
                CakeAssert.IsArgumentNullException(record, nameof(request));
            }
示例#3
0
        async Task <FindItemResponse> Online.ISalesManager.FindItemAsync(FindItemRequest request)
        {
            var validationProxy = Proxy.ForComponent <IValidationEngine>(this);
            await validationProxy.ValidateAsync(new ValidateCriteria());

            var restaurantProxy = Proxy.ForComponent <IRestaurantAccess>(this);
            await restaurantProxy.FilterAsync(new RestaurantCriteria());

            var orderingEngine = Proxy.ForComponent <IOrderingEngine>(this);
            await orderingEngine.MatchAsync(new ItemCriteria());

            var pricingProxy = Proxy.ForComponent <IPricingEngine>(this);
            await pricingProxy.CalculateAsync();

            return(MapInternalToPublic());
        }
示例#4
0
        public IHttpActionResult Find(FindItemRequest request)
        {
            if (request == null)
            {
                return(BadRequest(AppStatusCode.InvalidInput, "Find request object must be provided."));
            }

            var response = _recipeStore.FindRecipes(request.FieldName, request.Value, request.Strategy, request.Limit);

            if (response.Code != AppStatusCode.Ok)
            {
                Log.ErrorFormat("POST /recipes/find failed for field {0} and value {1} with code {2}. {3}", request.FieldName, request.Value, (int)response.Code, response.Message);
                return(InternalServerError(response.Code, response.Message));
            }

            return(Ok(response));
        }
示例#5
0
            public void Should_Return_Catalog_Item(string folder, string itemName)
            {
                //Given
                ICakeContext           context  = _Context;
                SsrsConnectionSettings settings = _Settings;
                FindItemRequest        request  = new FindItemRequest
                {
                    Folder    = folder,
                    ItemName  = itemName,
                    Recursive = true
                };

                //When
                var item = SsrsAliases.SsrsFindItem(context, request, settings);

                //Then
                Assert.NotNull(item);
            }
示例#6
0
            public void Should_Throw_On_Null_SettingsConfigurator_Parameter()
            {
                //Given
                ICakeContext context = _Context;
                Action <SsrsConnectionSettings> settingsConfigurator = null;
                FindItemRequest request = new FindItemRequest
                {
                    Folder    = "/AdventureWorks",
                    ItemName  = null,
                    Recursive = true
                };

                //When
                var record = Record.Exception(() => SsrsAliases.SsrsFindItem(context, request, settingsConfigurator));

                //Then
                CakeAssert.IsArgumentNullException(record, nameof(settingsConfigurator));
            }
示例#7
0
            public void Should_Throw_On_Null_Or_Empty_Folder_Parameter()
            {
                //Given
                ICakeContext           context  = _Context;
                SsrsConnectionSettings settings = _Settings;
                FindItemRequest        request  = new FindItemRequest
                {
                    Folder    = null,
                    ItemName  = "Item Name",
                    Recursive = true
                };

                //When
                var record = Record.Exception(() => SsrsAliases.SsrsFindItem(context, request, settings));

                //Then
                CakeAssert.IsArgumentNullException(record, nameof(request.Folder));
            }