Visual studio feeds

All Visual Studio blogs in one place


Enter your email address:

Delivered by FeedBurner

Increase your website traffic with



Anti-spam: How many eyes has a typical person?

Follow us on FB


tSQLt and the INSERT EXEC Problem - SQLServerCentral

AddThis Social Bookmark Button
tSQLt and the INSERT EXEC Problem - SQLServerCentral

For those new to the tSQLt framework, you should know that the typical
pattern for testing a stored procedure that produces a result set is

ASSIGN: Use a series of INSERT INTO …… VALUES(….) statements stage
the data to the tables that are going to be used in the procedure
Create a table to hold the expected results and stage the table with the expected data
ACT: Execute the procedure insert the results to the temp table with code like INSERT #actual EXEC myProc_sp
ASSERT: Compare the expected results to the actual results and throw an error if there’s a differenceUnfortunately, SQL Server has a restriction that you cannot nest an
INSERT..EXEC statement. If myProc_sp uses an INSERT..EXEC statement,
“INSERT #actual EXEC myProc_sp” fails with an “INSERT..EXEC statement
cannot be nested” message.

Rewriting the stored procedure to fit the framework involved a great
deal of effort and risk. Instead I wanted to get around...(Read whole news on source site)

How Company Culture Shapes Employee Motivation

AddThis Social Bookmark Button
How Company Culture Shapes Employee Motivation

We’ve found that answering three questions can help transform culture
from a mystery to a science:

1) How does culture drive performance?

What is culture worth?

3) What processes in an organization affect

In this article, we address each of these to show how leaders
can engineer high-performing organizational cultures — and measure their
impact on the bottom line.

(10 x the score for play) + (5 x purpose) + (1 2/3
x potential) – (1 2/3
x emotional pressure) – (5 x economic pressure) – (10 x inertia)...(Read whole news on source site)

Entity Framework Pitfalls: Attaching New Entities With Existing Related Ones

AddThis Social Bookmark Button
One of the patterns in EF 6.x for attaching new entities to a context is to simply change it’s state to Added: ctx.Entry(myEntity).State = EntityState.Added; Entity Framework 6.x will traverse the entity graph of all the related entities and set all their states to Added too. This might be a problem. Imagine we want to … Continue reading Entity Framework Pitfalls: Attaching New Entities With Existing Related Ones

Dynamic code generation in C#

AddThis Social Bookmark Button
Let us assume that we have the following simple task: Given a Dictionary, convert that dictionary into a type in as performant a manner as possible. The conversion will happen many time, and first time costs are acceptable. The answer we came up with is to dynamically generate the code based on the type. Basically, here is how it looks like: public static Func, T> Generate() where T : new() { var dic = Expression.Parameter(typeof (Dictionary), "dic"); var tmpVal = Expression.Parameter(typeof (string), "tmp"); var args
= new List(); foreach (var propertyInfo in typeof(T).GetProperties()) { var tryGet = Expression.Call(dic, "TryGetValue", new Type[0], Expression.Constant(propertyInfo.Name), tmpVal); Expression value = tmpVal; if (propertyInfo.PropertyType != typeof (string)) { var convertCall = Expression.Call(typeof(Convert).GetMethod("ChangeType",...(Read whole news on source site)

The Morning Brew #2026

AddThis Social Bookmark Button
Information The Error Model – Joe Duffy Feature Toggles (Working with feature-toggled systems) – Pete Hodgson FormatFilter and MediaTypeMappings in ASP.NET Core 1.0 MVC – Filip W JavaScript Unit Test Code Coverage Using NodeJS – Dave M Bush Testing That Your Public APIs Have Not Changed Unexpectedly with PublicApiGenerator and Approval Tests – Jason Roberts […]

Data Mocking - A way to test the untestable

AddThis Social Bookmark Button
Some of the biggest challenges when testing software can be getting the software into some very specific states. You want to test that the new error message works, but this message is only shown when something on the back-end breaks and the back-end has never broken before because it always “just works”. Maybe the software you have to test is powered by other people’s data, data that you have no direct control over and you really need to manipulate this data in order to perform your tests. Imagine you are testing a piece of software which displays the names of local
businesses as values as a drop-down list. This software might look something like this… There are only three items on this list at the moment, but this may not always be the case. There is currently no option within the software itself to change or manipulate the text displayed on the list because the software retrieves this list of data from someone else’s API. We have no control over the data returned by the API, our software under test just displays it. You have been asked to test the drop-down box. What would you do? Well most testers would start by looking at it. It...(Read whole news on source site)

How to get the Process Description of an external process using C#?

AddThis Social Bookmark Button
Sometime we need to find out details of running process which is external to your current process, might be a third party one. If you are currently looking for some code to find out details of a process, this post will definitely help you. Here we will learn, how to get the process description using C#.   Continue reading to learn about it. Also, sample code has been shared for you to understand it better. If you have specific query, drop a line in the comment section.     If
you open the Task Manager in your Windows system and navigate to the details tab, as shown below, you will find out the various process names running in your system. This includes the name of the process, the process ID (aka. PID), status of the process and the description.   If you are a developer and looking for an way to retrieve using C#, the “Process” instance doesn’t return this information. To do this, we need to iterate thru the Win32_Process using the ManagementObjectSearcher.       Normal SQL like query “Select...(Read whole news on source site)