I'm new to Moq and mocking.
I have a class Car
and I want to Mock this class:
Car car = Mock<Car>();
开发者_如何学Python
I'm getting the error "Cannot implicitly convert type 'Moc.Mock' to 'Car'.
It seems I could do this if I had:
Car car = Mock<ICar>();
However I don't actually have a ICar
Can anyone tell me how to achieve the mock of Car
?
var mockCar = Mock<Car>();
// Configure the mock properties and methods.
Car car = mockCar.Object;
精彩评论