Пример #1
0
        public void Testpish()
        {
            string      input       = @"pish is X
how much is pish ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);

            Assert.AreEqual("pish is 10", output);
        }
Пример #2
0
        public void Testtegj()
        {
            string      input       = @"tegj is L
how much is tegj ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);

            Assert.AreEqual("tegj is 50", output);
        }
Пример #3
0
        public void Testglob()
        {
            string      input       = @"glob is I
how much is glob ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);

            Assert.AreEqual("glob is 1", output);
        }
Пример #4
0
        public void Testprok()
        {
            string      input       = @"prok is V
how much is prok ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);

            Assert.AreEqual("prok is 5", output);
        }
Пример #5
0
        public void TestHowMuch()
        {
            string      input       = @"glob is I
prok is V
pish is X
tegj is L
how much is pish tegj glob glob ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);

            Assert.AreEqual("pish tegj glob glob is 42", output);
        }
Пример #6
0
        public void TestNoIdea()
        {
            string      input       = @"glob is I
prok is V
pish is X
tegj is L
how much wood could a woodchuck chuck if a woodchuck could chuck wood ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);

            Assert.AreEqual("I have no idea what you are talking about", output);
        }
Пример #7
0
        public void TestHowMany_GlobProkSilver()
        {
            string      input       = @"glob is I
prok is V
pish is X
tegj is L
glob glob Silver is 34 Credits
how many Credits is glob prok Silver ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);

            Assert.AreEqual("glob prok Silver is 68 Credits", output);
        }
Пример #8
0
        public void TestHowMany_GlobProkIron()
        {
            string      input       = @"glob is I
prok is V
pish is X
tegj is L
pish pish Iron is 3910 Credits
how many Credits is glob prok Iron ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);

            Assert.AreEqual("glob prok Iron is 782 Credits", output);
        }
Пример #9
0
        public void TestHowMany_GlobProkGold()
        {
            string      input       = @"glob is I
prok is V
pish is X
tegj is L
glob prok Gold is 57800 Credits
how many Credits is glob prok Gold ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);

            Assert.AreEqual("glob prok Gold is 57800 Credits", output);
        }
Пример #10
0
        /// <summary>
        /// Переход в сообщение
        /// </summary>
        async void navigationDrawerList_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            MessageMain item = navigationDrawerList.SelectedItem as MessageMain;

            if (item == null)
            {
                navigationDrawerList.SelectedItem = null;
                return;
            }

            navigationDrawerList.SelectedItem = null;
            await MasterPage.navPage.PushAsync(new UI.Message.Main(item.thread_id, item.from.FullName));
        }
Пример #11
0
        public void TestHowManyEx()
        {
            string      input       = @"glob is I
prok is V
pish is X
tegj is L
glob glob Silver is 34 Credits
glob prok Gold is 57800 Credits
pish pish Iron is 3910 Credits
how much wood could a woodchuck chuck if a woodchuck could chuck wood ?
how many Silver is glob Gold ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);
            string      answer      = @"I have no idea what you are talking about
glob Gold is 850 Silver";

            Assert.AreEqual(answer, output);
        }
Пример #12
0
        /// <summary>
        /// 根据模板ID和参数获取邮件标题和内容
        /// </summary>
        /// <param name="connectionString"></param>
        /// <param name="templateId"></param>
        /// <param name="dicParams"></param>
        /// <returns></returns>
        public static MessageMain GetReplaceParametersMessageMainById(string connectionString, string templateId, Dictionary <string, string> dicParams)
        {
            MessageMain result = new MessageMain();

            DataTable dt = QuartzExtScheduler.Common.MessageTemplate.GetOpMessageTemplate(connectionString, templateId);

            if (dt != null && dt.Rows.Count > 0)
            {
                result.Title   = Convert.ToString(dt.Rows[0]["message_title"]);
                result.Content = Convert.ToString(dt.Rows[0]["content"]);

                if (dicParams != null && dicParams.Count > 0)
                {
                    result.Title   = QuartzExtScheduler.Common.MessageTemplate.ReplaceVariable(result.Title, dicParams);
                    result.Content = QuartzExtScheduler.Common.MessageTemplate.ReplaceVariable(result.Content, dicParams);
                }
            }
            return(result);
        }
Пример #13
0
        public void TestAll()
        {
            string      input       = @"glob is I
prok is V
pish is X
tegj is L
glob glob Silver is 34 Credits
glob prok Gold is 57800 Credits
pish pish Iron is 3910 Credits
how much is pish tegj glob glob ?
how many Credits is glob prok Silver ?
how many Credits is glob prok Gold ?
how many Credits is glob prok Iron ?
how much wood could a woodchuck chuck if a woodchuck could chuck wood ?";
            MessageMain messageMain = new MessageMain();
            var         output      = messageMain.Start(input);
            string      answer      = @"pish tegj glob glob is 42
glob prok Silver is 68 Credits
glob prok Gold is 57800 Credits
glob prok Iron is 782 Credits
I have no idea what you are talking about";

            Assert.AreEqual(answer, output);
        }