Represents a collection of functions to interact with the API endpoints
Наследование: IStoreApi
Пример #1
0
        public void TestGetInventory()
        {
            // set timeout to 10 seconds
            Configuration c1 = new Configuration (timeout: 10000);

            StoreApi storeApi = new StoreApi (c1);
            Dictionary<String, int?> response = storeApi.GetInventory ();

            foreach(KeyValuePair<string, int?> entry in response)
            {
                Assert.IsInstanceOf (typeof(int?), entry.Value);
            }
        }
Пример #2
0
        public void TestGetInventoryInObject()
        {
            // set timeout to 10 seconds
            Configuration c1 = new Configuration (timeout: 10000);

            StoreApi storeApi = new StoreApi (c1);
            Newtonsoft.Json.Linq.JObject response = (Newtonsoft.Json.Linq.JObject)storeApi.GetInventoryInObject ();

            // should be a Newtonsoft.Json.Linq.JObject since type is object
            Assert.IsInstanceOf (typeof(Newtonsoft.Json.Linq.JObject), response);

            foreach(KeyValuePair<string, string> entry in response.ToObject<Dictionary<string, string>>())
            {
                Assert.IsInstanceOf (typeof(int?), Int32.Parse(entry.Value));
            }
        }
Пример #3
0
        public void GetInventoryTest()
        {
            // TODO: add unit test for the method 'GetInventory'
            //var response = instance.GetInventory();
            //Assert.IsInstanceOf<Dictionary<string, int?>> (response, "response is Dictionary<string, int?>");

            // set timeout to 10 seconds
            Configuration c1 = new Configuration (timeout: 10000);

            StoreApi storeApi = new StoreApi (c1);
            Dictionary<String, int?> response = storeApi.GetInventory ();

            foreach(KeyValuePair<string, int?> entry in response)
            {
                Assert.IsInstanceOf (typeof(int?), entry.Value);
            }
        }
Пример #4
0
 public void Init()
 {
     instance = new StoreApi();
 }