public BasePropertyChanger GetPropertyChanger() { ChangeString result = new ChangeString(); result.SetValue(txtStringValue.Text); return(result); }
public void BuildSecondTest() { var expected = "**Dbtb 52"; var actual = ChangeString.build("**Casa 52"); Assert.AreEqual(expected, actual); }
public void BuildFirstTest() { var expected = "123 bcde*3"; var actual = ChangeString.build("123 abcd*3"); Assert.AreEqual(expected, actual); }
public void TestMethod3() { //First string cadenaPrueba = "Daniel 2019 Gutierrez"; ChangeString objetoPrueba = new ChangeString(); Console.WriteLine(objetoPrueba.build(cadenaPrueba)); }
public void TestMethod2() { //First string cadenaPrueba = "123 abcd*3"; ChangeString objetoPrueba = new ChangeString(); Console.WriteLine(objetoPrueba.build(cadenaPrueba)); }
public void buildTest2() { string value = "**Casa 52"; string actual = ChangeString.build(value); string expected = "**Dbtb 52"; Assert.AreEqual(expected, actual); }
public void buildTest() { string value = "123 abcd*3"; string actual = ChangeString.build(value); string expected = "123 bcde*3"; Assert.AreEqual(expected, actual); }
public void test3_ChangeString() { ChangeString oChangeString = new ChangeString(); string texto = "## InterFaz 52"; string resultado = oChangeString.build(texto); Assert.AreEqual("## JñufsGba 52", resultado); }
public void TestMethod1() { //First string cadenaPrueba = "**Casa 52Z"; ChangeString objetoPrueba = new ChangeString(); Console.WriteLine(objetoPrueba.build(cadenaPrueba)); }
public BasePropertyChanger GetPropertyChanger() { //Talespire.Log.Debug($"EdtMiniGrouper.GetPropertyChanger() -- lastSerializedData = \"{LastSerializedData}\""); ChangeString result = new ChangeString(); result.SetValue(LastSerializedData); return(result); }
static string timeConversion(string s) { string StringToNewString, ChangeString; int StringToInt; //remove the specific chars ChangeString = s.Replace(":", ""); //remove am , pm char AmPm = ChangeString[6]; if (AmPm == 'a' || AmPm == 'A') { StringToNewString = ChangeString.Remove(2, 6); StringToInt = Int32.Parse(StringToNewString); if (StringToInt < 12) { if (StringToInt != 11 || StringToInt != 10) { StringToNewString = Convert.ToString(StringToInt); StringToNewString = String.Concat("0", StringToNewString); } else { StringToNewString = Convert.ToString(StringToInt); } } else { StringToNewString = "00"; } } else { //get the two beggining chars in new string to convert it StringToNewString = ChangeString.Remove(2, 6); //convert to int and plus 12 StringToInt = Int32.Parse(StringToNewString); if (StringToInt < 12) { StringToInt = StringToInt + 12; //convert it back to string StringToNewString = Convert.ToString(StringToInt); } else { StringToNewString = "12"; } } // replace new string to the old string s = s.Remove(0, 2); s = s.Remove(6, 2); s = String.Concat(StringToNewString, s); return(s); }
public void ChangeStringTest() { const String Entrada = "**Casa 52"; const String Salida = "**Dbtb 52"; var Resultado = ChangeString.build(Entrada); Assert.AreEqual(Salida, Resultado); }
static void Main(string[] args) { ChangeString ChangeString = new ChangeString(); Console.WriteLine("Introduzca un texto"); var texto = Console.ReadLine(); var response = ChangeString.build(texto); Console.WriteLine("El texto convertido es:{0}", response); }
static void Main(string[] args) { // ------- Ejercicio 1 ----------------------------- CLASE ChangeString String output; String input; ChangeString cs = new ChangeString(); Console.WriteLine("Ingrese Cadena:"); input = Console.ReadLine(); output = cs.build(input); Console.WriteLine("Salida:"); Console.Write(output); Console.ReadKey(); //--------- ejercicio 2 ----------------------------- CLASE OrderRange //ArrayList np; //ArrayList nr; //String input; //OrderRange or = new OrderRange(); //Console.WriteLine("Ingrese Números enteros positivos, separados por comas ejm(1,2,3,4...):"); //input = Console.ReadLine(); //or.build(input, out np, out nr); //Console.WriteLine("Salida:"); //Console.WriteLine("Colección de Pares:"); //foreach (object n in np) //{ // Console.Write("{0},", n); //} //Console.WriteLine("\nColección de Resto:"); //foreach (object n in nr) //{ // Console.Write("{0},", n); //} //Console.ReadKey(); //--------- ejercicio 3 ----------------------------- CLASE MoneyParts //ArrayList output; //String input; //MoneyParts mp = new MoneyParts(); //Console.WriteLine("Ingrese Monto, para obtener combinaciones:"); //input = Console.ReadLine(); //output = mp.build(input); //Console.WriteLine("\nSalida:"); //foreach (object n in output) //{ // Console.Write("{0} ", n); //} //Console.ReadKey(); }
public void Problema1() { //Planteamiento string entrada1 = "123 abcd*3"; string entrada2 = "**Casa 52"; string esperado1 = "123 bcde*3"; string esperado2 = "**Dbtb 52"; //Prueba var prueba1 = ChangeString.build(entrada1); var prueba2 = ChangeString.build(entrada2); //Resultado Assert.AreEqual(esperado1, prueba1); Assert.AreEqual(esperado2, prueba2); }
public void ChangeString() { //Planteamiento string entrada1 = "123 abcd*3"; string salida1 = "123 bcde*3"; string entrada2 = "**Casa 52"; string salida2 = "**Dbtb 52"; //Prueba var changeString = new ChangeString(); var result1 = changeString.build(entrada1); var result2 = changeString.build(entrada2); //Afirmacion Assert.AreEqual(salida1, result1); Assert.AreEqual(salida2, result2); }
public void build() { string cadena = "244434 bchksthk ZdA 7778"; ChangeString ts = new ChangeString(); try { // Act string result = ts.build(cadena); // Assert Assert.IsNotNull(result); } catch (Exception) { Assert.Fail(); } }
/// <summary> /// ChangeItemsInList() updates all matching strings by replacing every instance of pattern with an empty string /// </summary> /// <param name="changeString"></param> /// <param name="pattern"></param> public void ChangeItemsInList(ChangeString changeString, string pattern = null) { int index = 0; while (index < Words.Count) { string str = Words[index]; switch (changeString) { case ChangeString.DeleteText: str = str.Replace(pattern, ""); Words[index] = str; break; } index++; } }
public static int InspectorFieldInfoPopUp(string current, int index, ChangeString del) { string[] names = GetFieldNames(); int choice = 0; GUILayout.BeginHorizontal(); choice = UnityEditor.EditorGUILayout.Popup("Message", index, names); // if (GUILayout.Button ("Refresh")) { // Messages.RefreshFieldInfo (); // } GUILayout.EndHorizontal(); string selected = (string)fields [choice].GetValue(Messages.ins); if (choice >= 0 && !selected.Equals(current) && del != null) { del(selected); return(choice); } return(index); }
public void Init() { _changeString = new ChangeString(); }
static void Main(string[] args) { var player = new ChangeString(); player.Process(); }
private void button1_Click(object sender, EventArgs e) { string entrada = "**Casa 52"; ChangeString obj = new ChangeString(); string output = obj.build(entrada); }
static void Main(string[] args) { ChangeString ChangeString = new ChangeString(); OrderRange OrderRange = new OrderRange(); MoneyParts MoneyParts = new Clases.MoneyParts(); string cadena = ""; int nroEjercicio; int[] coleccion = null; Console.WriteLine("Escriba el nro de Ejercicio a probar 1, 2 o 3"); nroEjercicio = Convert.ToInt32(Console.ReadLine()); while (nroEjercicio == 1 || nroEjercicio == 2 || nroEjercicio == 3) { switch (nroEjercicio) { case 1: Console.WriteLine("Cadena de Entrada: "); cadena = Console.ReadLine(); Console.Write(""); Console.WriteLine("Cadena de Salida : " + ChangeString.build(cadena)); Console.WriteLine("Escriba el nro de Ejercicio a probar 1, 2 o 3"); nroEjercicio = Convert.ToInt32(Console.ReadLine()); break; case 2: Console.WriteLine("Ingrese la coleccion de enteros separado por comas:"); cadena = Console.ReadLine(); var listaNumeros = cadena.Split(','); coleccion = new int[listaNumeros.Count()]; for (int i = 0; i < listaNumeros.Length; i++) { coleccion[i] = Convert.ToInt32((listaNumeros[i].ToString())); } var resultList = OrderRange.build(coleccion); Console.WriteLine(string.Join(",", resultList[0])); Console.WriteLine(string.Join(",", resultList[1])); Console.WriteLine(""); Console.WriteLine("Escriba el nro de Ejercicio a probar 1, 2 o 3"); nroEjercicio = Convert.ToInt32(Console.ReadLine()); break; case 3: Console.WriteLine("Ingrese el monto en soles:"); cadena = Console.ReadLine(); var res = MoneyParts.build(cadena); foreach (var item in res.Values) { Console.WriteLine(string.Join(",", item)); } Console.WriteLine(""); Console.WriteLine("Escriba el nro de Ejercicio a probar 1, 2 o 3"); nroEjercicio = Convert.ToInt32(Console.ReadLine()); break; default: break; } } }
private void txtCadenaEntrada1_TextChanged(object sender, EventArgs e) { ChangeString oChangeString = new ChangeString(); txtCadenaSalida1.Text = oChangeString.build(txtCadenaEntrada1.Text); }