Beispiel #1
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.Text == "Capitalized")
            {
                output.WriteLine("Writing the texts as: Capitalized");
                phone.ChangeFormat(OutputFormat.FormatToUpper);
            }

            if (comboBox1.Text == "Reverse Capitalized")
            {
                output.WriteLine("Writing the texts as: Reverse Capitalized");
                phone.ChangeFormat(OutputFormat.FormatToLower);
            }


            if (comboBox1.Text == "Sort")
            {
                output.WriteLine("Writing the texts as: Sort");
                phone.ChangeFormat(OutputFormat.FormatFunish);
            }

            if (comboBox1.Text == "Shorten")
            {
                output.WriteLine("Writing the texts as: Shorten");
                phone.ChangeFormat(OutputFormat.FormatShorten);
            }

            if (comboBox1.Text == "Replace")
            {
                output.WriteLine("Writing the texts as: Replace");
                phone.ChangeFormat(OutputFormat.FormatReplacer);
            }
        }
Beispiel #2
0
        public void PrintWithFilter_UserFilterEnabled_OnlySelectedDate()
        {
            //arrange
            FilterValueDTO   filterValueDTO = new FilterValueDTO("Jacob", "MESSAGE", DateTime.Now, DateTime.Now.Add(new TimeSpan(1, 0, 0)));
            MessageStorage   smsStorage     = new MessageStorage();
            MobilePhone      mobile         = new MobilePhone(Model.Iphone8, output, smsStorage);
            MessageInisiator inisiator      = new ThreadMessageInisiator(mobile);

            fakeForm.FilterDict.Add(FilterCheckBox.User, false);
            fakeForm.FilterDict.Add(FilterCheckBox.Message, false);
            fakeForm.FilterDict.Add(FilterCheckBox.Date, true);

            //act
            mobile.ChangeFormat(OutputFormat.FormatToUpper);
            mobile.Messages.Add(new Message(jacob, "testMessage from Jacob", DateTime.Now));
            mobile.Messages.Add(new Message(thomas, "testMessage from Thomas", DateTime.Now.Add(new TimeSpan(3, 0, 0))));
            mobile.ViewMessages(fakeForm.FilterDict, filterValueDTO);

            //assert
            string outputFromMobile = output.WriteLineText;
            string jacobString      = "";
            string thomasString     = "";

            if (outputFromMobile.IndexOf("JACOB") > 0)
            {
                jacobString = outputFromMobile.Substring(outputFromMobile.IndexOf("JACOB"), 5);
            }

            if (outputFromMobile.IndexOf("THOMAS") > 0)
            {
                thomasString = outputFromMobile.Substring(outputFromMobile.IndexOf("THOMAS"), 6);
            }
            Assert.AreEqual(jacobString, "JACOB");
            Assert.AreEqual(thomasString, "");
        }
Beispiel #3
0
        [Ignore] // SMS received no longer automaticly gets printed.
        public void SMSReceived_FormatDelegateSort_OutputIsSorted()
        {
            //arrange
            var smsStorage = new MessageStorage();
            var mobile     = new MobilePhone(Model.Iphone8, output, smsStorage);
            var inisiator  = new ThreadMessageInisiator(mobile);

            //act
            mobile.ChangeFormat(OutputFormat.FormatFunish);
            inisiator.OnElapsedHandler(this, new MessageEventArgs(new Message(jacob, "testMessage", DateTime.Now)));

            //assert
            string outputFromMobile = output.WriteLineText;

            Assert.AreEqual(outputFromMobile, "Maeeegssstt");
        }