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

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

            leilao.Propoe(new Lance(jobs, 2000.0));
            leilao.Propoe(new Lance(wozniak, 3000.0));

            Assert.AreEqual(2, leilao.Lances.Count);
            Assert.AreEqual(2000, leilao.Lances[0].Valor, 0.00001);
            Assert.AreEqual(3000, leilao.Lances[1].Valor, 0.00001);
            Console.WriteLine(wozniak.Nome);
        }
        public void DeveCalcularMedia()
        {
            Leilao leilao = new CriadorDeLeilao().Para("Playstation")
                            .Lance(maria, 250.0)
                            .Lance(joao, 300)
                            .Lance(jose, 400)
                            .Constroi();

            leilao.Propoe(new Lance(maria, 250.0));
            leilao.Propoe(new Lance(joao, 300.0));
            leilao.Propoe(new Lance(jose, 400.0));

            leiloeiro.Avalia(leilao);

            Assert.AreEqual(317.0, leiloeiro.Media, 0.00001);
        }
        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.0, leilao.Lances[0].Valor, 0.00001);
        }
Beispiel #4
0
        public void DeveReceberUmLance()
        {
            Leilao leilao = new CriadorDeLeilao().Para("Mackbook Pro 15").Constroi();

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

            leilao.Propoe(new Lance(jobs, 2000.0));

            Assert.AreEqual(1, leilao.Lances.Count);
            Assert.AreEqual(2000, leilao.Lances[0].Valor, 0.00001);
        }