public void GetVehicles() { //Arrange var vehiclesL = new List <Vehicle>(); var vehicle1 = new Vehicle { Id = 1, Humidity = 25.00, Temperature = 30.05 }; var vehicle2 = new Vehicle { Id = 2, Humidity = 35.00, Temperature = 40.05 }; vehiclesL.Add(vehicle1); vehiclesL.Add(vehicle2); vehicleService.Setup(c => c.GetVehicles()).Returns(vehiclesL); //Act var getVehiclesResult = _VehicleController.AllVehicles(); //Assert Assert.IsType <List <Vehicle> >(getVehiclesResult); }