This blog post is a bit more lengthly than my usual posts and the idea came from an issue I faced when working in one of our project where we use an OData v3 REST interface that talks to an MS SQL Server (2012 R2) via EntityFramework v6.1.3. In short: we wanted to implement ‘entity framework row level security’ (in […]
When using Microsoft CodeContracts your Contract.Requires and Contract.Ensures statements will throw a ContractException which you cannot catch (per design). This means that you cannot use the [ExceptedException] attribute to assert them. Furthermore when mocking with Telerik Justock you cannot use Contract.Ensures and Contract.Requires at all in your stubs, as the stub is expected to be a Func in the form […]
In one of our projects we started using Service Bus for Windows Server 1.1. After the installation and configuration we searched for a tool to visualize the local Service Bus […]
When writing ODATA controllers for our projects we spend quite some time on writing boilerplate code and input parameter validation. In addition, for our error handling we would like detailed information for internal troubleshooting but not so detailed information sent back to the client (i.e. no stack traces). In order to achieve this without extra work we started looking at […]
Todays blog post shows how to set up a build configuration on a JetBrains TeamCity 9.1 server that creates and publishes a NuGet package of a C#/.NET-Project. Build Configuration Setup […]
While working with OData controllers I came accross a challenge concerning authentication. The used authentication mode is Windows Authentication. I wanted to invoke an OData controller through a service reference from another OData controller with the user of the original call. The user of the original call has to be impersonated because the controller encapsulated as a service reference checks, […]
To etablish the principle of Behaviour Driven Development in our development process we searched for a possibility to verify, if an acceptance criteria is fullfilled or not. Because we usually host our repositories at GitHub we decided to use the GitHub issue tracker to describe our features and acceptance criterias. Setup Issues As a first step the following two additional […]
Today I would like to quickly present you how to unit test Web.API based OData Controllers the easy way. On biz.dfch.CS.Examples.Odata you find a complete code example and some accompanying information. The idea is based on the following information (and slightly enhanced): * Unit Testing Web API OData Services – Part 1 * Unit Testing Web API OData Services – […]
While searching for a mocking framework for C# .NET we of d-fens stumbled over JustMock. JustMock is a mocking framework for unit testing developed and maintained by Telerik. Besides JustMock Telerik provides a huge palette of development tools. The probably most popular tool developed by them is Fiddler. Now let’s go back to JustMock. There are two versions of JustMock […]
Prerequisites The following requirements have to be met for creating a build job for a C# project. Running TeamCity instance (Setup manual can be found here) MS Build Tools have […]