Пример #1
0
        /// <summary>
        /// The handle query.
        /// </summary>
        /// <param name="parameters">
        /// The parameters.
        /// </param>
        /// <returns>
        /// The handle query.
        /// </returns>
        private string handleQuery(dynamic parameters)
        {
            string query = this.Request.Url.Query;

            var question = new Question(query);

            Debug.WriteLine(query);
            Debug.WriteLine(question.Input);

            return question.Answer();
        }
Пример #2
0
 public void WhatIsTheNumberInTheFibonacciSequenceSuccess()
 {
     var question =
         new Question("?q=6866b9f0:%20what%20is%20the%203th%20number%20in%20the%20Fibonacci%20sequence");
     Assert.AreEqual("2", question.Answer());
 }
Пример #3
0
 public void WhatIsPlusSuccess()
 {
     var question = new Question("?q=a26775c0:%20what%20is%2013%20plus%204");
     Assert.AreEqual("17", question.Answer());
 }
Пример #4
0
 public void WhatIsPlusPowerSuccess()
 {
     var question = new Question("?q=36824d70:%20what%20is%208%20to%20the%20power%20of%2010");
     Assert.AreEqual("1073741824", question.Answer());
 }
Пример #5
0
 public void WhatIsPlusPlusSuccess()
 {
     var question = new Question("?q=61da64e0:%20what%20is%2012%20plus%209%20plus%203");
     Assert.AreEqual("24", question.Answer());
 }
Пример #6
0
 public void WhatIsMultipliedSuccess()
 {
     var question = new Question("?q=0a104430:%20what%20is%205%20multiplied%20by%207");
     Assert.AreEqual("35", question.Answer());
 }
Пример #7
0
 public void WhatIsMinusSuccess()
 {
     var question = new Question("?q=5d965990:%20what%20is%204%20minus%201");
     Assert.AreEqual("3", question.Answer());
 }
Пример #8
0
 public void WhatCurrencyUseBeforeEuroSuccess()
 {
     var question = new Question("?q=30e93940:%20what%20currency%20did%20Spain%20use%20before%20the%20Euro");
     Assert.AreEqual("peseta", question.Answer());
 }
Пример #9
0
 public void WhatColorIsSuccess()
 {
     var question = new Question("?q=370f6f70:%20what%20colour%20is%20a%20banana");
     Assert.AreEqual("yellow", question.Answer());
 }
Пример #10
0
 public void WhoIsThePrimeMinisterOfGreatBritainSuccess()
 {
     var question = new Question("?q=5844c680:%20who%20is%20the%20Prime%20Minister%20of%20Great%20Britain");
     Assert.AreEqual("cameron", question.Answer());
 }
Пример #11
0
 public void WhichOfTheFollowingNumbersIsTheLargestSuccess()
 {
     var question =
         new Question(
             "?q=9c330490:%20which%20of%20the%20following%20numbers%20is%20the%20largest:%20555,%2011,%2085,%20887");
     Assert.AreEqual("887", question.Answer());
 }
Пример #12
0
 public void WhichOfTheFollowingNumbersIsBothSquareAndCubeSuccess()
 {
     var question =
         new Question(
             "?q=46e2df40:%20which%20of%20the%20following%20numbers%20is%20both%20a%20square%20and%20a%20cube:%20784,%20166");
     Assert.AreEqual(string.Empty, question.Answer());
     question =
         new Question(
             "?q=6583da30:%20which%20of%20the%20following%20numbers%20is%20both%20a%20square%20and%20a%20cube:%2046656,%20139");
     Assert.AreEqual("46656", question.Answer());
 }
Пример #13
0
 public void WhichOfTheFollowingNumbersArePrimesSuccess()
 {
     var question =
         new Question("?q=3f7d2d30:%20which%20of%20the%20following%20numbers%20are%20primes:%203,%209,%2011");
     Assert.AreEqual("3, 11", question.Answer());
 }