public void NaoDeveDobrarCasoNaoHajaLanceAnterior() { Leilao leilao = new Leilao("Macbook Pro 15"); Usuario steveJobs = new Usuario("Steve Jobs"); leilao.DobraLance(steveJobs); Assert.AreEqual(0, leilao.Lances.Count); }
public void NaoDeveDobrarLancesConsecutivos() { Leilao leilao = new Leilao("Mac Book Pro 500"); Usuario ygor = new Usuario("Ygor"); leilao.DobraLance(ygor); Assert.AreEqual(0, leilao.Lances.Count()); }
public void DeveDobrarOUltimoLanceDado() { Leilao leilao = new Leilao("Macbook Pro 15"); Usuario steveJobs = new Usuario("Steve Jobs"); Usuario billGates = new Usuario("Bill Gates"); leilao.Propoe(new Lance(steveJobs, 2000)); leilao.Propoe(new Lance(billGates, 3000)); leilao.DobraLance(steveJobs); Assert.AreEqual(4000, leilao.Lances[2].Valor, 0.00001); }
public void DeveDobrarLanceAnterior() { Leilao leilao = new Leilao("Mac Book Pro 500"); Usuario ygor = new Usuario("Ygor"); Usuario roberta = new Usuario("Roberta"); leilao.Propoe(new Lance(ygor, 150.0)); leilao.Propoe(new Lance(roberta, 250.0)); leilao.DobraLance(ygor); Assert.AreEqual(300, leilao.Lances[2].Valor, 0.0001); }
public void DobralanceDeUsuario() { Leilao leilao = new Leilao("Macbook Pro 15"); Usuario steveJobs = new Usuario("Steve Jobs"); Usuario billGates = new Usuario("Bill GAtes"); leilao.Propoe(new Lance(steveJobs, 2000)); leilao.Propoe(new Lance(billGates, 3000)); leilao.DobraLance(steveJobs); Assert.AreEqual(3, leilao.Lances.Count); var ultimo = leilao.Lances.Count - 1; Lance ultimoLance = leilao.Lances[ultimo]; Assert.AreEqual(4000, ultimoLance.Valor, 0.00001); }
public void VerificaDobraLance() { Usuario joao = new Usuario("Joao"); Usuario maria = new Usuario("maria"); Leilao leilao = new Leilao("Playstation 3 Novo"); leilao.Propoe(new Lance(joao, 100.0)); leilao.Propoe(new Lance(maria, 200.0)); leilao.Propoe(new Lance(joao, 150.0)); leilao.Propoe(new Lance(maria, 200.0)); leilao.DobraLance(joao); Assert.AreEqual(5, leilao.Lances.Count); Assert.AreEqual(100, leilao.Lances[0].Valor, 0.0001); Assert.AreEqual(200, leilao.Lances[1].Valor, 0.0001); Assert.AreEqual(150, leilao.Lances[2].Valor, 0.0001); Assert.AreEqual(200, leilao.Lances[3].Valor, 0.0001); Assert.AreEqual(300, leilao.Lances[4].Valor, 0.0001); }