You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m trying to mock ICountryFactory but with no luck. Here is the code:
var _countryFactory = new Mock<ICountryFactory>();
_countryFactory
.Setup(f => f.CreateCountry(It.IsAny<string>()))
.Returns(new Country
{
Name = "Switzerland"
});
And then I get these errors:
The type 'PostalCodes.Country' has no constructors defined
Property or indexer 'Name' cannot be assigned to -- it is read only
The text was updated successfully, but these errors were encountered:
I’m trying to mock ICountryFactory but with no luck. Here is the code:
And then I get these errors:
The text was updated successfully, but these errors were encountered: