コード例 #1
0
        public void FormatTimeLastAndUpperTest()
        {
            Message sms      = new Message("Masha", DateTime.Now);
            string  expected = $"{sms.Text.ToUpper()} [{DateTime.Now}] {Environment.NewLine}";
            string  current  = MessageBoxLab4.FormatTimeLastAndUpper(sms);

            Assert.IsTrue(expected.Equals(current));
        }
コード例 #2
0
        public void FormatTimeFirstTest()
        {
            Message sms      = new Message("Petya", DateTime.Now);
            string  expected = $"[{DateTime.Now}] {sms.Text} {Environment.NewLine}";
            string  current  = MessageBoxLab4.FormatTimeFirst(sms);

            Assert.IsTrue(expected.Equals(current));
        }
コード例 #3
0
        public void DataSelectorTest3()
        {
            MobileLab4 mobile   = new MobileLab4();
            Message    message1 = new Message("Petya", DateTime.Now);
            Message    message2 = new Message("Masha", DateTime.Now);

            mobile.Storage.Add(message1);
            mobile.Storage.Add(message2);

            List <Message> current = MessageBoxLab4.DataSelector(
                mobile, "Masha", new DateTime(2018, 1, 1), new DateTime(2018, 1, 2), "text", "OR").ToList();

            Assert.IsTrue(mobile.Storage.Messages.ToString().Equals(current.ToString()));
        }
コード例 #4
0
        public void DataSelectorTest2()
        {
            MobileLab4 mobile   = new MobileLab4();
            Message    message1 = new Message("Petya", DateTime.Now);
            Message    message2 = new Message("Masha", DateTime.Now);

            mobile.Storage.Add(message1);
            mobile.Storage.Add(message2);

            List <Message> current = MessageBoxLab4.DataSelector(
                mobile, "Masha", new DateTime(2018, 1, 1), new DateTime(2018, 1, 2), "text", "AND").ToList();

            Assert.IsTrue(current.Count == 0);
        }