我有一个班车,我想模拟这个班:
Car car = Mock<Car>();
我收到错误“无法将类型’Moc.Mock’隐式转换为’Car’.
如果我有以下情况,我似乎可以这样做:
Car car = Mock<ICar>();
但是我实际上没有ICar
谁能告诉我如何实现汽车的模拟?
var mockCar = Mock<Car>(); // Configure the mock properties and methods. Car car = mockCar.Object;