code-contracts
Preconditions and Postconditions in CodeContracts
If I write 开发者_C百科 [Pure] static string s10 {get;set;} static void Main(string[] args) { Contract.Ensures(s10.Length <= 10); //Contract fails[详细]
2023-03-26 00:11 分类:问答CodeContract problem with ensures
I got the following code: protected virtual string FormatException(Exception exception, int intendation)[详细]
2023-03-25 09:18 分类:问答Is Code Contracts failing to spot obvious relationship between Nullable<T>.HasValue and null?
I am experimenting with applying Code Contracts to my code and I\'ve hit a perplexing problem. This code is failing to meet the contract but unless I\'m being really thick I would expect it to be able[详细]
2023-03-23 12:59 分类:问答Why does CodeContracts warn me that "requires unproven: index < @this.Count" even though I have already checked the count?
I have code that looks something like this: public class Foo<开发者_StackOverflow;T> : ObservableCollection<T>[详细]
2023-03-23 10:29 分类:问答Pex not satisfying code contract
I\'m trying to wrote a pex test, and I noticed that it always was feeding a false value as one of the params that I wanted. My test looked like this (simplified: there are/were more params, but otherw[详细]
2023-03-23 09:49 分类:问答Auto-implemented properties with non null guard clause?
I do agree with Mark Seeman\'s notion that Automatic Properties are somewhat evil as they break encapsulation. However I do like the concise syntax, readability and convenience they bring.[详细]
2023-03-22 10:21 分类:问答What keywords/tools are there to help the compiler optimise
Often we\'re told things like, If you\'re calling a method with a return value that doesn\'t change, take it out of the loop.[详细]
2023-03-21 20:10 分类:问答Building coded ui test project fails when "Perform runtime contract checking" is set to "full"
I have a simple Test project where a CodedUITestMethod is created. The test method simply clicks the Windows Start button in the taskbar. The method is generated by the Coded UI Test Buil开发者_如何学[详细]
2023-03-21 04:58 分类:问答Code Contracts at runtime
As far as I read in a nutshell book, code contracts could degrade the runtime performance. Is it possible to disable code co开发者_JAVA百科ntracts in production?The user manual explains this in a fai[详细]
2023-03-20 14:49 分类:问答Using Code Contracts, why does ccrewrite require access to every runtime dependency?
I\'m trying to use Code Contracts and I\'m running into a problem that is blocking me.With Contract Reference Assembly set to Build, ccrewrite is erroring while trying to access assemblies that are re[详细]
2023-03-18 14:05 分类:问答