Howdy folks, Here we are back again with an introduction of the new features of the upcoming Visual Studio 2010. Its release has been postponed to the 12th of April, so in the meantime we’ll have to stick to the Beta 2, which is pretty stable already. There are so many improvements that we’ll have [...]
Archive for January, 2010
Visual Studio 2010: New Features Part 1: UI
Posted in c#, Snippet, Uncategorized, visual studio, tagged beta, code editor, code snippet, developer, development, features, ms_feeds, Visual Studio 2010, vs, windows7, wpf on January 30, 2010 | 4 Comments »
NHibernate Troubles #3: Mapping NULL Values to Integer
Posted in c#, nhibernate, tips, tagged ambiguity, mapping, ms_feeds, null, null values, nullable, nullable type, windows7 on January 27, 2010 | 2 Comments »
Dear community, It’s me once more with a small but handy hint that can make your coding and maintaining a bit easier. When mapping columns to integral types, it certainly is possible that a field’s value is NULL, right? Now, let’s assume a hypothetical table ORDER that contains a field QUANTITY. Assume also that we [...]
Code Contracts: Static Checker ignores Objects Invariant for Same Type Parameter
Posted in Automation, c#, Code Contracts, Unit testing, visual studio, tagged assumption, Code Contracts, Design by Contract, ignore, ms_feeds, object invariant, postcondition, static checker, warning, windows7, workaround on January 25, 2010 | Leave a Comment »
Howdy all, Here comes another post about Code Contracts. Remember my post First Steps with Code Contracts? Let’s just recall which class we have been working on last time: 1: namespace Vehicles 2: { 3: class Car : IVehicle 4: { 5: string name; 6: int speed; 7: 8: public Car(string name, int speed) 9: [...]
Code Contracts: C# Code Snippets for Visual Studio
Posted in Automation, c#, Code Contracts, tips, visual studio, tagged cheat sheet, Code Contracts, ms_feeds, snippet, user manual, visual studio, windows7 on January 22, 2010 | 2 Comments »
Howdy, The Code Contracts User Manual holds (besides detailed information about Code Contracts’ usage, advantages and drawbacks) a few nice lists of Code Snippets that ship with the Code Contracts and will ease your life. Find below the list of available Code Snippets for the C# language, as exactly taken from the User Manual (January [...]
NHibernate troubles #2: Criteria Queries using IN
Posted in c#, nhibernate, tips, Uncategorized, tagged criteria, criterion, hql, mapping, ms_feeds, nhibernate, query, range of values, troubles, windows7 on January 22, 2010 | 1 Comment »
Howdy ladies and gents out there, Here we go with another NHibernate common problem solved for you. Recently the question arose whether it is possible or not to execute a query with NHibernate that checks whether a property lies in a given range of values or not. Not much of a problem, we would say, [...]
Code Contracts on Interfaces
Posted in Uncategorized, tagged Code Contracts, Design by Contract, interfaces, ms_feeds, precondition, visual studio, windows7 on January 22, 2010 | Leave a Comment »
Hello all, This time we’ll do a quick exploration of how we can apply Code Contracts to interfaces. As you know from our post First Steps with Code Contracts, the preconditions and postconditions (Contract.Requires and Contract.Ensures calls, respectively) must be placed inside a method body. Therefore, when defining an interface, we run into a problem: [...]
First Steps with Code Contracts
Posted in Automation, c#, Code Contracts, Unit testing, tagged Assertions, Code Contracts, Design by Contract, ms_feeds, postcondition, precondition, Tools, Visual Studio 2010, windows7 on January 21, 2010 | 4 Comments »
Hello all, Today we are going to talk about another exciting project from the Microsoft Research Labs: Code Contracts. It is a Design-By-Contract (DbC) system, that enables us as developers to formulate the expected behaviour of our code by directly putting it into the code. The main tools of applying Code Contracts are: Static checking [...]
Pex and Moles: Untestable Code? Not really.
Posted in Automation, c#, Moles, Pex, Unit testing, tagged delegate, detouring, generation, moles framework, ms_feeds, stub, testing interfaces, untestable, windows7 on January 21, 2010 | 4 Comments »
Howdy folks, So far, we have seen how to let Pex automatically generate unit tests, and how to generate PUT customizations while testing interfaces. However, there are a few cases you might come across, where Pex cannot generate test cases for your code. This is the case, if you try to test code that is: [...]
Pex PUT Customization Update: Use Lambda Expressions instead of Anonymous Methods
Posted in Automation, c#, Pex, tips, Unit testing, tagged advice, anonymous function, delegate, lambda expression, Pex, unit test, update on January 19, 2010 | Leave a Comment »
Howdy, In reference to my previous post, Pex: Parametrized Unit Tests and their Customization, I’d like to publish an update: I received an interesting comment by Peli, that the following code piece should be replaced by a lambda expression, in order to make it more readable. Hence, I’d advice that you should just replace the [...]
Pex: Parametrized Unit Tests and their Customization
Posted in Automation, c#, Pex, tips, Uncategorized, Unit testing, tagged autmation, customizing, ms_feeds, parametrized unit test, put, test, Unit testing, white box testing on January 19, 2010 | 5 Comments »
Hello, You might already guess it: Pex won’t let me go, and so I’d like to explain in short a few of Pex’ concepts. 1.1 Code Coverage Pex is an abbreviation for Program Exploration. You guessed it: Nomen est omen. It analyzes the branches (if, then, else, etc…) of control flow and tries to cover [...]

