Beispiel #1
0
        public void DeveReceberUmLance()
        {
            Leilao leilao = new CriadorDeLeilao().Para("Macbook Pro 15").Constroi();

            Assert.AreEqual(0, leilao.Lances.Count);

            leilao.Propoe(new Lance(new Usuario("Steve Jobs"), 2000));

            Assert.AreEqual(1, leilao.Lances.Count);
            Assert.AreEqual(2000, leilao.Lances[0].Valor, 0.00001);
        }
Beispiel #2
0
        public void DeveEntenderLeilaoComAPenasUmLance()
        {
            Leilao leilao = new CriadorDeLeilao().Para("Playstation 3 Novo")
                            .Lance(joao, 1000)
                            .Constroi();

            leilao.Propoe(new Lance(joao, 1000.0));

            leiloeiro.Avalia(leilao);

            Assert.AreEqual(1000, leiloeiro.MaiorLance, 0.0001);
            Assert.AreEqual(1000, leiloeiro.MenorLance, 0.0001);
        }
        public void DeveLancarArgumentExceptionCasoLanceComValorMenorQue0()
        {
            var leilao = new CriadorDeLeilao().Para("Geladeira").Constroi();

            Assert.Throws <ArgumentException>(() => leilao.Propoe(new Lance(new Usuario("Joao"), -100)));
        }