Ejemplo n.º 1
0
        public void MakeQueryUserTest()
        {
            // -- Arrange
            var messageList = new List <MobilePhone.BL.Message>
            {
                new MobilePhone.BL.Message {
                    User = "******", Text = "testText1", ReceivingTime = DateTime.Now
                },
                new MobilePhone.BL.Message {
                    User = "******", Text = "testText2", ReceivingTime = DateTime.Now
                },
                new MobilePhone.BL.Message {
                    User = "******", Text = "testText3", ReceivingTime = DateTime.Now
                },
            };
            var form            = new FormMessageFormating();
            var receiversFilter = "2222";
            var textFilter      = "";
            var filteringLogic  = "";
            var expected        = "testText1testText3";

            // -- Act
            var    query  = form.MakeQuery(messageList, receiversFilter, textFilter, filteringLogic);
            string actual = "";

            foreach (var m in query)
            {
                actual += $"{m.Text}";
            }

            // -- Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void SetMessageFormatTest()
        {
            // -- Arrange
            string        message  = "simcorp test";
            MessageFormat format   = MessageFormat.Uppercase;
            var           expected = "SIMCORP TEST";

            // -- Act
            var actual = FormMessageFormating.SetMessageFormat(message, format);

            // -- Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void MobilePhoneBatteryUnChange()
        {
            // -- Arrange
            var form = new FormMessageFormating();

            form.mobile.Battery.Charge = 50;
            var expected = 0;

            // -- Act
            Task.WaitAll(form.batteryUnCharge());
            var actual = form.mobile.Battery.Charge;

            // -- Assert
            Assert.AreEqual(expected, actual);
        }