Esempio n. 1
0
        public void GetInventoryInObjectTest()
        {
            // TODO: add unit test for the method 'GetInventoryInObject'
            var response = instance.GetInventoryInObject();

            Assert.IsInstanceOf <Object> (response, "response is Object");
        }
Esempio n. 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));
            }
        }