public void SaveNewCase_PositiveTest()
        {
            CaseDetails caseDetails = new CaseDetails();
            caseDetails.UserId = Guid.NewGuid().ToString();
            caseDetails.UserName = "******";
            caseDetails.Title = "I would like to host a party";
            caseDetails.ContactPreference = new List<string>()
            {
                "Chat",
                "Email",
            };

            caseDetails.Tags = new List<string>()
            {
                "PartyPlanning",
            };

            caseDetails.RequestDetails = "My birthday is on the 25 of may and I would like a party";

            SaveNewCaseRequestContainer requestContainer = new SaveNewCaseRequestContainer() { CaseInfo = caseDetails, ProviderName = "SqlProvider"};
            SaveNewCaseReturnContainer returnContainer = CommandTestHelper.SendRequest<SaveNewCaseRequestContainer, SaveNewCaseReturnContainer>("SaveNewCase", requestContainer);

            Assert.AreEqual(returnContainer.ReturnCode, ReturnCodes.C101, "Return codes.");
        }
        /// <summary>
        /// Called when [execute].
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>BaseReturnContainer object</returns>
        public override BaseReturnContainer OnExecute(RequestContext context)
        {
            GetUserCasesRequestContainer requestContainer = context.InParam as GetUserCasesRequestContainer;
            GetUserCasesReturnContainer returnContainer = new GetUserCasesReturnContainer();

            ISqlProvider sqlProvider = (ISqlProvider)ProviderFactory.Instance.CreateProvider<ISqlProvider>(requestContainer.ProviderName);
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("@userId", requestContainer.UserId);
            parameters.Add("@deleted", false);

            DataSet result = sqlProvider.ExecuteQuery(SqlQueries.GetUserCasesQuery, parameters);

            if(result.Tables.Count < 1)
            {
                throw new ApplicationException("Query failed");
            }

            returnContainer.Cases = new List<CaseDetails>();
            foreach (DataRow row in result.Tables[0].Rows)
            {
                CaseDetails caseDetails = new CaseDetails();
                caseDetails.CaseId = row["CaseId"].ToString();
                caseDetails.Title = row["Title"].ToString();

                bool tempBool = false;
                bool.TryParse(row["NewMessage"].ToString(), out tempBool);
                caseDetails.NewMessage = tempBool;

                string tempString = row["AssignedAgentId"].ToString();
                if (tempString != DBNull.Value.ToString())
                {
                    caseDetails.AssignedAgentId = tempString;
                }
                else
                {
                    caseDetails.AssignedAgentId = string.Empty;
                }

                tempString = row["Name"].ToString();
                if (tempString != DBNull.Value.ToString())
                {
                    caseDetails.AssignedAgentName = tempString;
                }
                else
                {
                    caseDetails.AssignedAgentName = string.Empty;
                }

                DateTimeOffset tempDateTimeOffset;
                if (DateTimeOffset.TryParse(row["DateTimeUpdated"].ToString(), out tempDateTimeOffset))
                {
                    caseDetails.LastUpdateDateTime = tempDateTimeOffset;
                }
                else
                {
                    // Log an error
                }

                returnContainer.Cases.Add(caseDetails);
            }

            returnContainer.ReturnCode = ReturnCodes.C101;
            return returnContainer;
        }