-
-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic code contracts for public facing API #95
Conversation
1. Added code contract to project compilation 2. Added not null postcondition to mock factory methods 3. Added not null postcondition to "Object" properties on mock
1. Added code contracts to release build 2. Disabled contract analysis for Moq itself
@@ -33,6 +33,40 @@ | |||
<MergeReferences>false</MergeReferences> | |||
<NoWarn> | |||
</NoWarn> | |||
<CodeContractsEnableRuntimeChecking>False</CodeContractsEnableRuntimeChecking> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these code contracts properties seem to be duplicated in Debug/Release configurations. It's better to put them outside, in a new property group specific for this feature, and only leave in Debug/Release the deltas.
This settings are usually configured by means of a GUI (an extra page on the project properties) inside Visual Studio. I'm unsure as to what the configuration behaviour would be should they be grouped up in another manner. While we can reduce code duplication by using a higher level property group, it's worth noting that these settings are independent of each other, and despite their verbosity, do follow the existing project standard of having each configuration contain it's own settings, as seen in properties like and . |
I don't like the duplication. And we're most certainly not going to change And since it's plain msbuild, the effect of changing the grouping is none. /kzu from mobile
|
Basic code contracts for public facing API
I'll fix the XML later. |
Hi @APeel , looks like these changes weren't #ifdef'ed and we've a broken build for SL now :( Any chance you can look at that? |
(on behalf of @APeel) |
This adds basic postconditions for Mock creation.
See issue: Add support for code contracts