Esempio n. 1
0
        public void GetVehiclesBadDealer()
        {
            var result = new Controllers.VehicleController(_context, _mapper).GetVehicles("bad").Result.Result as BadRequestObjectResult;

            Assert.IsNotNull(result);
            Assert.AreEqual(400, result.StatusCode);
            Assert.AreEqual("Invalid dealer provided in Vehicle request.", result.Value);
        }
Esempio n. 2
0
        public void GetVehiclesDealerTwo()
        {
            var result  = new Controllers.VehicleController(_context, _mapper).GetVehicles("dealer 2").Result.Value.ToList();
            var vehicle = result[0] as ViewModels.Dealer2Vehicle;

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Any());
            Assert.IsNotNull(vehicle);
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(1, vehicle.Id);
            Assert.AreEqual(101m, vehicle.Price);
            Assert.AreEqual("Active", vehicle.Status);
        }