Exemplo n.º 1
0
        public void VornamenSindUngleich()
        {
            var t1 = new ss("Karli", "Burli");
            var t2 = new ss("Hansi", "Burli");

            Assert.AreNotEqual(t1.Vorname, t2.Vorname);
        }
Exemplo n.º 2
0
        public void IchFehle()
        {
            string newTick = File.ReadAllText(@"C:\Users\user\Desktop\Kunde - Kopie.json");
            ss     s       = JsonConvert.DeserializeObject <ss>(newTick);

            Assert.AreNotEqual(s.Nachname, "Pöll");
        }
Exemplo n.º 3
0
        public void NachnameVorhanden()
        {
            Assert.Catch(() =>
            {
                var x = new ss("A", "");
            }

                         );
        }
Exemplo n.º 4
0
        public void VornameVorhanden()
        {
            Assert.Catch(() =>
            {
                var x = new ss("", "B");
            }

                         );
        }
Exemplo n.º 5
0
        public static void test()
        {
            ss test = new ss("Arnold", "Schwarzenegger");

            test.GebDatum = DateTime.Parse("24/12/2000");
            string s = JsonConvert.SerializeObject(test);

            File.WriteAllText(@"C:\Users\user\Desktop\Test.json", s);
            using (StreamReader r = new StreamReader(@"C:\Users\user\Desktop\Test.json"))
            {
                string json = r.ReadToEnd();

                dynamic array = JsonConvert.DeserializeObject(json);


                Console.WriteLine("DeSerialize Test \n");
                Console.WriteLine("{0} {1} {2} {3}", array.Kundennummer, array.Nachname, array.Vorname, array.GebDatum);
            }
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            string temp_vorname, temp_nachname;

            TextInfo ti = new CultureInfo("de-de", false).TextInfo;



            Console.WriteLine("Bitte Vorname eingeben :\n");
            temp_vorname = Console.ReadLine();
            Console.WriteLine("Bitte Nachname eingeben :\n");
            temp_nachname = Console.ReadLine();
            ss a = new ss(temp_vorname, temp_nachname);


            Console.WriteLine("Hallo " + a.Kundennummer + " " + ti.ToTitleCase(a.Vorname) + " " + ti.ToTitleCase(a.Nachname) + "\n");

            Console.WriteLine("Bitte anderen Nachnamen eingeben :\n");
            a.Nachname = Console.ReadLine();
            Console.WriteLine("Bitte Geburtsdatum eingeben :\n");
            a.GebDatum = DateTime.Parse(Console.ReadLine());
            Console.Clear();

            Console.WriteLine("--------------------------------------------------------\n");
            Console.WriteLine(ti.ToTitleCase(a.Vorname) + " " + ti.ToTitleCase(a.Nachname) + "\n" + "Geb.Datum : " + a.GebDatum.Day + "." + a.GebDatum.Month + "." + a.GebDatum.Year + "\n" + "Kundennummer : " + a.Kundennummer + "\n");
            Console.WriteLine("--------------------------------------------------------\n");


            a.Print();
            a.PrintKundeData();
            NochEineKlasse b = new NochEineKlasse();

            b.Print();



            string s = JsonConvert.SerializeObject(a);

            File.AppendAllText(@"C:\Users\user\Desktop\Kunde.json", s);
            DeSerialize.test();
        }
Exemplo n.º 7
0
        public void NachnamePasst()
        {
            var x = new ss("A", "B");

            Assert.IsTrue(x.Nachname == "B");
        }
Exemplo n.º 8
0
        public void VornamePasst()
        {
            var x = new ss("A", "B");

            Assert.IsTrue(x.Vorname == "A");
        }