public void GetAllVehiclesModels_ShouldReturnAllVehiclesModels() { var vehiclesModels = new List <VehicleModel> { new VehicleModel { Id = 1 }, new VehicleModel { Id = 2 }, new VehicleModel { Id = 3 } }; var mockContext = new Mock <InstantDeliveryContext>(); mockContext.Setup(c => c.VehicleModels).ReturnsDbSet(vehiclesModels); var controller = new VehiclesController(mockContext.Object); var result = controller.GetModels() as OkNegotiatedContentResult <List <VehicleModel> >; var count = result?.Content.Count; Assert.Equal(count, 3); }