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()); }
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()); }
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()); }
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()); }