public void TestClass1() { const string expected = "1, 2, 3, 4, 5"; var generator = new Class1(); generator.SetRange(1, 5); var result = generator.GenerateOutput(); Assert.AreEqual(expected, result); }
static void Main(string[] args) { Class1 game = new Class1(); game.run(); Console.WriteLine("Press any key to exit"); Console.ReadLine(); }
static void Main(string[] args) { const String uri = "http://api.remix.bestbuy.com/v1/products(name=ipad*)?show=name,salePrice,preowned,mobileUrl&format=json&apiKey=YourAPIKey"; Class1 c = new Class1(); String json = c.GetData(uri); Console.WriteLine(json); parseJson pj = new parseJson(); Rootobject r = pj.parsejson(json); foreach(Product p in r.products) { Console.WriteLine(p.ToString()); } Console.Read(); }
static void Main(string[] args) { int a = 2; String s = ""; Console.WriteLine("ESCRIBA Y PARA CONTINUAR"); Class1 c = new Class1(); if (c.esPar(a) == true) { Console.WriteLine("ES PAR"); } else{Console.WriteLine("NO ES PAR");} do { s = Console.ReadLine(); if (s.Equals("y") == false) { Console.WriteLine("ERROR"); } } while (s.Equals("y") == false); }
static void Main(string[] args) { try { Class1 c1 = new Class1(); c1.Ping(); } catch (Exception ex) { while (ex != null) { Console.WriteLine("ERROR: {0}", ex.Message); ex = ex.InnerException; } } }
static void Main(string[] args) { d.Configuration.EnableJournaling = true; d.Configuration.BasePath = @"c:\densodb"; d.Session.Start(); d.Session.DefaultDataBase = "test"; var ss = d.Session.New; //var result = ss.Get<Class1>(c => c.Prop1 == "1" && c.Lista.Contains("test") || (c.Child != null && c.Child.Pppp1 == "kk")).ToList(); var cc = new Class1() { Prop1 = "1", Prop2 = "2", Prop3 = 3, Prop4 = 7, Child = new Class2() { Pppp1 = "kk", Pppp2 = "kkkkkk" } }; ss.Set(cc); d.Session.ShutDown(); }
static void Main(string[] args) { Class1 cs = new Class1(); bool on = true; string name = ""; string number = ""; while (on == true) { Console.WriteLine("Would you like to get all, add new, or quit?: \n"); string choise1 = Console.ReadLine(); switch (choise1) { case "get all": cs.GetAll(); break; case "get names": cs.GetNames(); break; case "add new": Console.WriteLine("What is the name?\n"); name = Console.ReadLine(); cs.AddName(name); Console.WriteLine("What is the number?\n"); number = Console.ReadLine(); cs.AddNumber(number); break; case "quit": on = false; break; default: Console.WriteLine("That is not a valid choise\n"); break; } } }
static void Main(string[] args) { Class1 c1 = new Class1(ref b); // Class1 c1 = new Class1(10); // Console.WriteLine(c1.h); // int h = 19; // Class2 c2 = new Class2(ref h); // Console.WriteLine(c2.h); //// Man m = new Man(new Saymen()); // Bull b = new Bull(new Saybull()); // m.Say(); // b.Say(); // b.Event += (sender, e) => // { // switch(e.ch) // { // case "cow": // { // b.SetISay(new Saybull()); // break; // } // case "men": // { // b.SetISay(new Saymen()); // break; // } // default: break; // } // }; // b.an_object_which_sees_the_minotaur("men"); // b.Say(); // b.an_object_which_sees_the_minotaur("cow"); // b.Say(); }
public object DeepClone() { Class1 c = new Class1(this.a); c.member = (Class1)this.member.Clone(); return c; }