public void budget_Project() { int s = 2; Projekt z = new Projekt(1, "Hugo"); z.Projektbudget = s; s *= 2; z.verdoppleBudget(); if (z.Projektbudget == s) { } }
static void Main(string[] args) { var m = new massnahme[3]; m[0] = new Programm(12); Projekt p = new Projekt(1, "Hugo"); Console.WriteLine("Projekt " + p.Projektname + " hat Nummer:" + p.Projektnummer); p.Projektname = "Franz"; p.Projektbudget = 27.23; m[1] = new Projekt(1, "Hallo"); m[2] = p; for (int i = 0; i < m.Length; i++) { try { m[i].printBudget(); } catch (Exception e) { throw e; } } p.verdoppleBudget(); Console.WriteLine("Projekt " + p.Projektname + " hat Nummer:" + p.Projektnummer + " und nun Budget: " + p.Projektbudget); var arr = new massnahme[] { new Projekt(1, "1"), new Programm(2), new Projekt(3, "3") }; //File & JSON try { string y = "Err"; var backupSettings = new JsonSerializerSettings() { Formatting = Formatting.Indented, TypeNameHandling = TypeNameHandling.Auto }; File.WriteAllText(@"c:\Users\Hannes\oom\tasks\Task3\text.json", JsonConvert.SerializeObject(arr, backupSettings)); if (File.Exists(@"c:\Users\Hannes\oom\tasks\Task3\text.json")) { y = File.ReadAllText(@"c:\Users\Hannes\oom\tasks\Task3\text.json"); } Console.WriteLine(y); var x = JsonConvert.DeserializeObject <massnahme[]>(y, backupSettings); for (int i = 0; i < 3; i++) { x[i].printBudget(); } } catch (Exception ei) { throw ei; } //Task 6 und 7 var sub = new Subject <Programm>(); sub .Where(Programm => Programm.Programmnummer > 10) .Subscribe(Programm => { Console.WriteLine(Programm.Programmnummer + " hat Budget: " + Programm.Programmbudget); } ); sub.OnNext(new Programm(1)); sub.OnNext(new Programm(17)); sub.OnNext(new Programm(12)); sub.OnNext(new Programm(4)); sub.OnNext(new Programm(10)); sub.OnNext(new Programm(5)); sub.OnNext(new Programm(176)); sub.OnNext(new Programm(90)); sub.OnNext(new Programm(7)); //Wegraeumen //sub.Dispose(); //Continue Task <double> result = Task.Run(calc); result.ContinueWith(x => Console.WriteLine(x.Result)); //Async var result2 = new WebClient().DownloadStringTaskAsync(new Uri("http://dev.orf.at/")); result2.ContinueWith(t => Console.WriteLine(t.Result)); }
public void second_fail_createProject() { Assert.Catch(() => { var g = new Projekt(-1, "Horst"); }); }
public void fail_createProject() { Assert.Catch(() => { var g = new Projekt(1, ""); }); }
public void nameProject() { Projekt y = new Projekt(1, "Hugo"); y.Projektname.Equals("Hugo"); }
public void createProject() { Projekt x = new Projekt(1, "Hugo"); }