Skip to content
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

Merged
merged 2 commits into from
Feb 21, 2014
Merged

Conversation

alexsimply
Copy link
Contributor

This adds basic postconditions for Mock creation.

See issue: Add support for code contracts

	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>
Copy link
Member

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.

@varon
Copy link

varon commented Feb 21, 2014

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 .

@kzu
Copy link
Member

kzu commented Feb 21, 2014

I don't like the duplication. And we're most certainly not going to change
any of those settings in the foreseeable future from VS.

And since it's plain msbuild, the effect of changing the grouping is none.

/kzu from mobile
On Feb 21, 2014 7:29 AM, "varon" [email protected] wrote:

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 .

Reply to this email directly or view it on GitHubhttps://github.com//pull/95#issuecomment-35717546
.

kzu added a commit that referenced this pull request Feb 21, 2014
Basic code contracts for public facing API
@kzu kzu merged commit 5f6f173 into devlooped:master Feb 21, 2014
@kzu
Copy link
Member

kzu commented Feb 21, 2014

I'll fix the XML later.

@kzu
Copy link
Member

kzu commented Aug 5, 2014

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?

@varon
Copy link

varon commented Aug 5, 2014

(on behalf of @APeel)
We're no longer using Moq here, so we're not going to look into it.
Should be simple to fix.
Otherwise just revert it, although it seems like a pretty popular issue.

kzu added a commit that referenced this pull request Aug 5, 2014
This reverts commit 5f6f173, reversing
changes made to 9bb3df8.

Conflicts:
	Source/Moq.csproj
@devlooped devlooped locked and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants