Visual studio 2013: Contract.Assume not generating exception at runtime?
hello guys.
i must missing something, can't see what. i'm creating new assembly .net 4.5.2 , i've enabled code contracts going project properties , doing following:
* set assembly mode standard contract requires
* enabled perform runtime contract checking
* chose option full on combo
* , chose build option contract reference assembly @ end of page
then, i've added folloowing existing class:
namespace domain.persistence {
public abstract class valueobject : base {
protected valueobject() {
var anyinvalidprops = gettype().getproperties()
.where(p => attribute.isdefined(p, typeof (domainsignatureattribute), true))
.any();
contract.assume(!anyinvalidprops);
}
}
}
while running unit tests, don't end getting exception (even when condition false!). clues on i'm missing?
luis abreu
luis abreu
DevLabs > Code Contracts
Comments
Post a Comment