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
Trying to make the best use out of "If more than one setup is specified for the same method or property, the latest one wins and is the one that will be excuted"
Later in the respective test methods i overwrite those setups with eg.
Which works perfectly for all the other methods expect the on above. Where for some reason it ignores the new setup completely and makes use of the setup or mock from the ctor.
It's a bit diffucult to puzzle together what exactly your code looks like, given only these fragments and screenshots. Could you perhaps show your code directly?
Assuming that the type of FeatureListWithItem is a reference type, are you aware that this setup will only ever trigger when you call _arcGis.Mock.AddFeatures with that exact object as an argument? That is, it won't be enough to pass in some list containing a specific feature; you'll have to pass in that specific list (and its contents will be irrelevant).
Encountered an unusal issue where the latest setup gets ignored (Cant find any similiar issues).
In the ctor of my TestClass i instantiate my repo with these setups.
(Returns the amount of affectedRows)
Trying to make the best use out of "If more than one setup is specified for the same method or property, the latest one wins and is the one that will be excuted"
Later in the respective test methods i overwrite those setups with eg.
_arcGis.Setup(x => x.AddFeatures(FeatureListWithItem)).ReturnsAsync(1);
Which works perfectly for all the other methods expect the on above. Where for some reason it ignores the new setup completely and makes use of the setup or mock from the ctor.
[DoesntWork]
[Works]
Assert.Equal() Failure
Expected: (1, 0, 0)
Actual: (0, 0, 0)
The text was updated successfully, but these errors were encountered: