public void Setup() { Character agustina = new Troll("Agustina"); Character Rafa = new Elf("Rafael"); Character Santy = new Wizard("El Santy"); Character nico = new Troll("El crack"); IItem espadadefuego = new EspadaDeFuego(); IItem palardo = new Palote(); IItem coraza = new Coraza(); IItem calibre_sinbalas_quepegaigual = new Calibre(); IItem pantalardoepico = new Pantalon(); IItem Epikpa = new CapaDeInvisibilidad(); List <IItem> Objetos = new List <IItem> { espadadefuego, palardo, coraza, calibre_sinbalas_quepegaigual, pantalardoepico, Epikpa }; List <Character> pejotas = new List <Character> { agustina, Rafa, Santy, nico }; Random random = new Random(); foreach (Character pejota in pejotas) { for (int i = 0; i < 2; i++) { int num = random.Next(); pejota.AddItem(Objetos[num]); } } }
public async Task <IActionResult> Put(int calibreId, Calibre model) { try { var calibre = await _repo.GetCalibreAsyncById(calibreId); if (calibre == null) { return(NotFound()); } _repo.Update(model); if (await _repo.SaveChangesAsync()) { return(Created($"/portal/calibre/{model.Id}", model)); } } catch (System.Exception) { return(this.StatusCode(StatusCodes.Status500InternalServerError, "Banco de dados falhou")); } return(BadRequest()); }
public async Task <IActionResult> Post(Calibre model) { try { _repo.Add(model); if (await _repo.SaveChangesAsync()) { return(Created($"/portal/calibre/{model.Id}", model)); } } catch (System.Exception) { return(this.StatusCode(StatusCodes.Status500InternalServerError, "Banco de dados falhou")); } return(BadRequest()); }
/// <summary> /// Maneja el evento que realizá la carga inicial del control /// </summary> /// <param name="sender">La fuente del evento.</param> /// <param name="e">Los argumentos de tipo <see cref="RoutedEventArgs"/> que contienen la información del evento.</param> private void MetroWindow_Loaded(object sender, RoutedEventArgs e) { this.cboCalibre.ItemsSource = Calibre.GetTableroCalibres(); if (this.SelectedCircuit != null) { this.txtCto.Text = String.Format("Cto. [{0}]", this.SelectedCircuit.ToString()); this.tboLong.Text = this.SelectedCircuit.LongitudAsString; string cboInput = ((ComboBoxItem)this.cboFactAgrup.Items[0]).Content.ToString(); if (double.Parse(cboInput) == this.SelectedCircuit.FactorAgrupacion) { this.cboFactAgrup.SelectedIndex = 0; } else { this.cboFactAgrup.SelectedIndex = 1; } this.cboCalibre.SelectedItem = this.SelectedCircuit.Calibre; } }
public void Test_implementsSearchForNewer() { var cl = new Calibre(false); Assert.IsTrue(cl.implementsSearchForNewer()); }