private void DoPostRequest()
 {
     for (int i = 0; i < 10; i++)
     {
         _conn.DoPostRequest(_toc.UriCrmAccount(_currentDivision), "{\"Name\": \"43905139517985179437\"}");
     }
 }
Exemple #2
0
        public void GetCollectionOfAccountsInJsonFormat_Succeeds()
        {
            var toc  = new TestObjectsCreator();
            var conn = new ApiConnection(toc.ApiConnector(), toc.UriCrmAccount(toc.GetCurrentDivision()));

            var            c        = new SimpleController(conn);
            List <dynamic> accounts = c.GetDynamic(string.Empty);

            // Test if list has entities (easy test, because actual entity count isn't known)
            if (accounts.Count < 1)
            {
                throw new Exception("User Story not correctly implemented: List of CRM/Accounts is empty");
            }
        }
        public void GetApiResponseAfterGetCall_Succeeds()
        {
            //APIConnector connector = new APIConnector(accesstoken);
            var toc  = new TestObjectsCreator();
            var conn = new ApiConnection(toc.ApiConnector(), toc.UriCrmAccount(toc.GetCurrentDivision()));

            string result = conn.Get(string.Empty);

            if (result == string.Empty)
            {
                throw new Exception("Return from API was empty");
            }
            else
            {
                // Check if the response is a JSON Value
                // Throws exception of not JSON
                JsonConvert.DeserializeObject(result);
            }
        }