示例#1
0
        public void ReturnTrueIfNullNoAdditional()
        {
            //act
            bool result = Q1_1.areAllCharsUniqueNoAdditional("");

            //assert
            Assert.IsTrue(result);
        }
示例#2
0
        public void  ReturnsFalseIfNotUnique()
        {
            //act
            bool result = Q1_1.areAllCharsUnique(_duplicateInput);

            //assert
            Assert.IsFalse(result);
        }
示例#3
0
        public void ReturnFalseIfNoUniqeNoAdditional()
        {
            //act
            bool result = Q1_1.areAllCharsUniqueNoAdditional(_duplicateInput);

            //assert
            Assert.IsFalse(result);
        }
示例#4
0
        public void ReturnsTrueIfUnique()
        {
            //act
            bool result = Q1_1.areAllCharsUnique(_uniqueInput);

            //assert
            Assert.IsTrue(result);
        }
        protected bool SaveData(out int rowID)
        {
            StringBuilder columnList = new StringBuilder();
            SQLParamList  sqlParams  = new SQLParamList();

            //Add details for email surveys
            //if (SurveyType == GEISurveyType.Email)
            //{
            //    columnList.Append(",[EmailBatch],[PIN]");
            //    sqlParams.Add("@EmailBatch", EmailPINRow["BatchID"])
            //             .Add("@PIN", EmailPIN);
            //    if (String.IsNullOrWhiteSpace(txtQ4_CardNumber.Text))
            //    {
            //        //If they erased the encore number, we'll put in a new one
            //        Q4.SelectedValue = 1;
            //        txtQ4_CardNumber.Text = EmailPINRow["Encore"].ToString();
            //    }
            //}

            txtEmail.PrepareQuestionForDB(columnList, sqlParams);
            Q1_1.PrepareQuestionForDB(columnList, sqlParams);
            Q1_2to4.PrepareQuestionForDB(columnList, sqlParams);
            Q1_5to9.PrepareQuestionForDB(columnList, sqlParams);
            Q1_10.PrepareQuestionForDB(columnList, sqlParams);

            Q2_No.PrepareQuestionForDB(columnList, sqlParams);
            Q2_Yes.PrepareQuestionForDB(columnList, sqlParams);

            Q3_No.PrepareQuestionForDB(columnList, sqlParams);
            Q3_Yes.PrepareQuestionForDB(columnList, sqlParams);

            Q4_Yes.PrepareQuestionForDB(columnList, sqlParams);
            Q4_No.PrepareQuestionForDB(columnList, sqlParams);
            Q4_EncoreNumber.PrepareQuestionForDB(columnList, sqlParams);

            Q5_Tarmac.PrepareQuestionForDB(columnList, sqlParams);
            Q5_BoxSeats.PrepareQuestionForDB(columnList, sqlParams);
            Q5_GroupPatio.PrepareQuestionForDB(columnList, sqlParams);
            Q5_MarqueeTent.PrepareQuestionForDB(columnList, sqlParams);
            Q5_SilksBuffet.PrepareQuestionForDB(columnList, sqlParams);
            Q5_DiamondClub.PrepareQuestionForDB(columnList, sqlParams);

            Q6_Excellent.PrepareQuestionForDB(columnList, sqlParams);
            Q6_VeryGood.PrepareQuestionForDB(columnList, sqlParams);
            Q6_Good.PrepareQuestionForDB(columnList, sqlParams);
            Q6_Fair.PrepareQuestionForDB(columnList, sqlParams);
            Q6_Poor.PrepareQuestionForDB(columnList, sqlParams);

            Q7_Excellent.PrepareQuestionForDB(columnList, sqlParams);
            Q7_VeryGood.PrepareQuestionForDB(columnList, sqlParams);
            Q7_Good.PrepareQuestionForDB(columnList, sqlParams);
            Q7_Fair.PrepareQuestionForDB(columnList, sqlParams);
            Q7_Poor.PrepareQuestionForDB(columnList, sqlParams);

            Q8_DefinitelyWould.PrepareQuestionForDB(columnList, sqlParams);
            Q8_ProbablyWould.PrepareQuestionForDB(columnList, sqlParams);
            Q8_MightMightNot.PrepareQuestionForDB(columnList, sqlParams);
            Q8_ProbablyWouldNot.PrepareQuestionForDB(columnList, sqlParams);
            Q8_DefinitelyWouldNot.PrepareQuestionForDB(columnList, sqlParams);

            Q9_Male.PrepareQuestionForDB(columnList, sqlParams);
            Q9_Female.PrepareQuestionForDB(columnList, sqlParams);

            Q10_19to24.PrepareQuestionForDB(columnList, sqlParams);
            Q10_25to34.PrepareQuestionForDB(columnList, sqlParams);
            Q10_35to44.PrepareQuestionForDB(columnList, sqlParams);
            Q10_45to54.PrepareQuestionForDB(columnList, sqlParams);
            Q10_55to64.PrepareQuestionForDB(columnList, sqlParams);
            Q10_65orOlder.PrepareQuestionForDB(columnList, sqlParams);

            Q11_35000.PrepareQuestionForDB(columnList, sqlParams);
            Q11_35000to59999.PrepareQuestionForDB(columnList, sqlParams);
            Q11_60000to89999.PrepareQuestionForDB(columnList, sqlParams);
            Q11_90000.PrepareQuestionForDB(columnList, sqlParams);
            Q11_NoSay.PrepareQuestionForDB(columnList, sqlParams);

            Q12_PostalCode.PrepareQuestionForDB(columnList, sqlParams);

            Q13_FirstName.PrepareQuestionForDB(columnList, sqlParams);
            Q13_LastName.PrepareQuestionForDB(columnList, sqlParams);
            Q13_Email.PrepareQuestionForDB(columnList, sqlParams);

            columnList.Append(",[PropertyID],[DateEntered]");
            sqlParams.Add("@PropertyID", 5)
            .Add("@DateEntered", DateTime.Now);



            columnList.Remove(0, 1);
            SQLDatabase sql = new SQLDatabase();    sql.CommandTimeout = 120;

            rowID = sql.QueryAndReturnIdentity(String.Format("INSERT INTO [tblHastingsSurvey] ({0}) VALUES ({1});", columnList, columnList.ToString().Replace("[", "@").Replace("]", String.Empty)), sqlParams);
            if (!sql.HasError && rowID != -1)
            {
                //Dictionary<string, int> wordCounts = SurveyTools.GetWordCount(Q11.Text, txtQ27A_OtherExplanation.Text, txtQ27B.Text, Q32.Text, Q34.Text, Q35.Text, Q39_16Explanation.Text);
                //SurveyTools.SaveWordCounts(SharedClasses.SurveyType.GEI, rowID, wordCounts);

                return(true);
            }
            else
            {
                return(false);
            }
        }