public void TestMethod4() { Factory factory = new Factory(); IUniverse soldado = factory.getUniverse("Soldado"); soldado.SetName("Capitán"); Assert.AreEqual("Capitán", soldado.GetName()); }
public void TestMethod3() { Factory factory = new Factory(); IUniverse planeta = factory.getUniverse("Planeta"); planeta.SetName("Mercurio"); Assert.AreEqual("Mercurio", planeta.GetName()); }
public void TestMethod2() { Factory factory = new Factory(); IUniverse rebelde = factory.getUniverse("Rebelde"); rebelde.SetName("Erick"); Assert.AreEqual("Erick", rebelde.GetName()); }
public void TestMethod1() { ServiceReferenceTest.WebServiceSoapClient serviceSoapClient = new ServiceReferenceTest.WebServiceSoapClient(); Factory factory = new Factory(); IUniverse Planeta = factory.getUniverse("Planeta"); IUniverse Rebelde = factory.getUniverse("Rebelde"); Rebelde.SetName("Erick"); Planeta.SetName("Venus"); Assert.IsTrue(serviceSoapClient.AddListServiceRebelde(Rebelde.GetName(), Planeta.GetName()), "algo ha fallado"); }
public void TestMethod2() { ServiceReferenceTest.WebServiceSoapClient serviceSoapClient = new ServiceReferenceTest.WebServiceSoapClient(); Factory factory = new Factory(); IUniverse Planeta = factory.getUniverse("Planeta"); IUniverse Rebelde = factory.getUniverse("Rebelde"); Rebelde.SetName("Erick"); Planeta.SetName("Venus"); serviceSoapClient.AddListServiceRebelde(Rebelde.GetName(), Planeta.GetName()); var listaRebeldes = serviceSoapClient.GetRebeldesService(); foreach (var values in listaRebeldes) { Assert.AreEqual("Erick" + "," + "Venus", values); } }
private void Button1_Click(object sender, EventArgs e) { DateTime localDate = DateTime.Now; IUniverse Planeta = factory.getUniverse("Planeta"); Object selectedItem = comboBox1.SelectedItem; try { if (selectedItem.ToString().Length > 0) { switch (selectedItem.ToString()) { case "Rebelde": IUniverse Rebelde = factory.getUniverse(selectedItem.ToString()); if (!Checktext(textBox1.Text, textBox2.Text)) { if (CheckTextVoid(textBox1.Text, textBox2.Text)) { Planeta.SetName(textBox2.Text); Rebelde.SetName(textBox1.Text); WebServiceSoapClient.AddListServiceRebelde(Rebelde.GetName(), Planeta.GetName()); //log.LogWrite("-. "+Rebelde.GetName() + ", " + Planeta.GetName()+"; "+localDate.ToString()) ; log.Add("Tipo " + selectedItem.ToString() + " Nombre: " + Rebelde.GetName() + ", Planeta: " + Planeta.GetName()); } else { MessageBox.Show("Campos vacios"); } } else { MessageBox.Show("Alguna cadena contiene caracteres no válidos"); } break; case "Soldado": IUniverse Soldado = factory.getUniverse(selectedItem.ToString()); if (!Checktext(textBox1.Text, textBox2.Text)) { if (CheckTextVoid(textBox1.Text, textBox2.Text)) { Planeta.SetName(textBox2.Text); Soldado.SetName(textBox1.Text); WebServiceSoapClient.AddListServiceSoldado(Soldado.GetName(), Planeta.GetName()); // log.LogWrite(Soldado.GetName() + ", " + Planeta.GetName() + "; " + localDate.ToString()); log.Add("Tipo " + selectedItem.ToString() + "Clase : " + Soldado.GetName() + ", Planeta: " + Planeta.GetName()); } else { MessageBox.Show("Campos vacios"); } } else { MessageBox.Show("Alguna cadena contiene caracteres no válidos"); } break; } } textBox1.Clear(); textBox2.Clear(); } catch (NullReferenceException ex) { MessageBox.Show("Debes seleccionar el tipo de Persona"); } }