Пример #1
0
        public void GreetingPractice()
        {
            var sut       = new PracticeClasss();
            var birthDate = "1971-04-05";
            var name      = "Mattias Asplund";
            var phone     = "070-6186120";

            sut.EnterDetails(birthDate, name, phone);
            var expected = "Mattias Asplund; was born 1971-04-05; and his phone no 070-6186120";

            Assert.AreEqual(expected, sut.Greeting);
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var birthDate = dateTimePicker1.Value.ToString("yyyy-MM-dd");


            var name  = textBoxName.Text;
            var phone = textBoxPhone.Text;

            praclass.EnterDetails(birthDate, name, phone);
            labelView.Text = praclass.Greeting;
            // MessageBox.Show(praclass.Greeting);

            File.WriteAllText(@"C:\Users\Studerande\Desktop\CSharpClass\Csharp\PracticeWindowsFormsApp\TextPracticeFile.txt", praclass.Greeting);

            string[] lines = File.ReadAllLines(@"C:\Users\Studerande\Desktop\CSharpClass\Csharp\PracticeWindowsFormsApp\TextPracticeFile.txt");

            foreach (var line in lines)
            {
                MessageBox.Show("\t" + line);
            }
        }