Ejemplo n.º 1
0
        public void Should_Throw_On_InValid_GetItemFilter()
        {
            var netoStore = GetStoreManager();
            var filter    = new GetItemFilter();

            Assert.Throws <NetoRequestException>(() => netoStore.Products.GetItem(filter));
        }
Ejemplo n.º 2
0
        static void GetItems(StoreManager neto)
        {
            var filter = new GetItemFilter(new int[] { 1, 2, 3, 50 });

            Item[] result = neto.Products.GetItem(filter);

            foreach (Item i in result)
            {
                Console.WriteLine($"{i.ID} - {i.Name}");
            }
        }
Ejemplo n.º 3
0
        public void Should_Get_Single_Product_From_ID(int id)
        {
            var netoStore = GetStoreManager();

            var filter = new GetItemFilter(id);

            Item[] result = netoStore.Products.GetItem(filter);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Length);
        }
Ejemplo n.º 4
0
        static void GetItemsFromDate(StoreManager neto)
        {
            var filter = new GetItemFilter();

            filter.DateAddedFrom = DateTime.Now.Add(-TimeSpan.FromDays(100));
            filter.Limit         = 2;

            Item[] result = neto.Products.GetItem(filter);

            foreach (Item i in result)
            {
                Console.WriteLine($"{i.ID} - {i.Name}");
            }
        }
Ejemplo n.º 5
0
        public void Should_Get_N_Limit_Products(int limit)
        {
            var netoStore = GetStoreManager();

            var filter = new GetItemFilter();

            filter.DateAddedFrom = DateTime.Now.Add(-TimeSpan.FromDays(100));
            filter.Limit         = limit;

            Item[] result = netoStore.Products.GetItem(filter);

            Assert.IsNotNull(result);
            Assert.AreEqual(limit, result.Length);
        }
Ejemplo n.º 6
0
        public void Should_Add_Product_With_Images()
        {
            var netoStore = GetStoreManager();

            NewItem[] item = new NewItem[] {
                GetTestAddProductWithImages()
            };

            var result = netoStore.Products.AddItem(item);

            Assert.IsNotNull(result);
            Assert.AreEqual(Ack.Success, result.Ack);
            Assert.AreEqual(result.Item.Count, 1);


            // Check for 3 images
            var filter = new GetItemFilter(Convert.ToInt32(result.Item[0].InventoryID));

            Item[] imageResult = netoStore.Products.GetItem(filter);
            Assert.AreEqual(imageResult.Length, 1);
            Assert.AreEqual(imageResult[0].Images.Count, 3);
        }