Esempio n. 1
0
        public void AutosPorEstado()
        {
            var mockDb = new Mock <ExamenContext>();

            mockDb.Setup(o => o.Autos).Returns(Autos.GetDbSet());

            var service = new AutoService(mockDb.Object);

            var result = service.getAuto(null, null, null, "nuevo", null, null);

            Assert.AreEqual(12, result.LongCount());
        }
Esempio n. 2
0
        public void TodoslosAutos()
        {
            var mockDb = new Mock <ExamenContext>();

            mockDb.Setup(o => o.Autos).Returns(Autos.GetDbSet());

            var service = new AutoService(mockDb.Object);

            var result = service.getAuto();

            Assert.AreEqual(18, result.LongCount());
        }
Esempio n. 3
0
        public void AutosMarcaAudi()
        {
            var mockDb = new Mock <ExamenContext>();

            mockDb.Setup(o => o.Autos).Returns(Autos.GetDbSet());

            var service = new AutoService(mockDb.Object);

            var result = service.getAuto("Audi", null, null, null, null, null);

            Assert.AreEqual(4, result.LongCount());
        }
Esempio n. 4
0
        public void AutosPorPrecioMaximo()
        {
            var mockDb = new Mock <ExamenContext>();

            mockDb.Setup(o => o.Autos).Returns(Autos.GetDbSet());

            var service = new AutoService(mockDb.Object);

            var result = service.getAuto(null, null, null, null, null, 50000);

            Assert.AreEqual(11, result.LongCount());
        }