Developers who have incorporated unit testing into their development process already know its advantages: cleaner code, courage to refactor, and improved productivity. Writing unit tests is easy; it is writing good tests that makes automated unit testing and test driven development powerful tools. This article provides some basic testing patterns that help write good tests.
In automated unit testing, it may be necessary to use objects or procedures that look and behave like their release-intended counterparts, but are actually simplified versions that reduce the complexity and facilitate testing. A test double is a generic (meta) term used for these objects or procedures. Types of test doubles Dummy objects are passed […]
In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.
The GROUP BY statement is used in conjunction with the aggregate functions to group the result-set by one or more columns. The following SQL statement counts as orders grouped by shippers: Try it yourself. GROUP BY More Than One Column Try it yourself. SQL HAVING Example
After a LINQ query is created by a user, it is converted to a command tree. A command tree is a representation of a query that is compatible with the Entity Framework. The command tree is then executed against the data source. At query execution time, all query expressions (that is, all components of the […]
There are so many variations of finding bound events to elements in jQuery and a lot of them just work in old versions. To be honest I can’t remember this line cause it looks ridiculous. I don’t understand why it is so complicated and even changes from old versions. In stackoverflow I found that “In jQuery […]
Earlier I wrote post named “Understanding ASP.NET MVC request process”. In this post we will dive a bit deeper into the lifecycle of an ASP.NET MVC application. A high-level view of the MVC application lifecycle, where you can understand the major stages that every MVC application passes through in the request processing pipeline. That was the […]
How Requests Are Processed by the Thread Pool On the web server, the .NET Framework maintains a pool of threads that are used to service ASP.NET requests. When a request arrives, a thread from the pool is dispatched to process that request. If the request is processed synchronously, the thread that processes the request is […]