To download a SQL file from an IIS hosted website the website needs to know how to handle the file. In general terms a SQL file is plain text, so the respective MIME type would be text/plain This can be added to IIS manually using the MIME types editor. Or for a more reliable approach... Continue Reading →
Working around Selenium
After you've used selenium for a while, you'll be familiar with some of the problems. Yep, WaitForElement doesn't exactly cover itself in glory. It is possible to work round this a bit using a static helper for retries. Something like this; public static void MyNavigateMethod(this IWebDriver driver, int retryCounter = 0) { try { driver.DoSomething();... Continue Reading →
Collect performance data from remote servers
To collect performance data from remote servers, when running a load test for example, use the following PowerShell script: clear$testId = "doodle"$durationSeconds = 20$threadsPerAgent = 5$client = ""$counterList = @( ".NET CLR Exceptions()# of Exceps Thrown / sec", ".NET CLR Memory()# Total committed Bytes", "\ASP.NET\Application Restarts", "\ASP.NET\Request Wait Time", "\ASP.NET\Requests Queued", "\ASP.NET Applications()\Requests/Sec", "\Web Service()\Current... Continue Reading →
Goldilocks and the 3 reseller packages
Goldilocks was walking through the wood one winters day when she came across a house with three computers. (Yes there was also fibre broadband installed - it's a tech savvy wood - get over it!) The first computer was connected to Fasthosts. A solid offering she thought, back by over a decade of experience. But... Continue Reading →
Arduino Uno 101: Using the SparkFun Inventor’s Kit (UK)
I’m an experienced programmer, but have only ever touched on electronics during A-levels and my degree course. New developer boards Arduino open up the world of micro-electronics to those with little or no experience. This is the start of my adventure: The kit I brought was the SparkFun Inventor's Kit for Arduino with Retail Case... Continue Reading →
Extract URL Information
To get information about the currently requested URL in ASP.NET use the Request.Url class. For example to extract the information from the URL http://www.example.com/myApp/myPage.aspx?myQs=14 the Request.Url class provides the following properties:
Entity Framework: StoreGeneratedPattern="Computed"
We recently had a problem where our fields with default values where not getting properly populated in the database during row creation. This can occur when the EDMX model is created in the designer and the default fields do not have their StoreGeneratedPattern property set to Computed or Identity. Easy enough to fix, simply open... Continue Reading →
The Art Of Unit Testing, TDD
My quote-of-the-day, regarding Test Driven Development: I am convinced that it [TDD] can work to your benefit, but it’s not without a price (time to learn, time to implement, and more). It’s definitely worth the admission price, though. Taken from the excellent The Art of Unit Testing: with Examples in .NET by Roy Osherove.
Real World: Unit Testing Queries Against Entity Framework (EF) Model / Repositories
Unit testing is a tricky beast. As with all unit tests it is important to abstract any dependencies – so in the case of EF it’s the data persistence source. This must be handled carefully because EF creates a container that performs the interaction with the data source. Abstracting that container (via mocking or stubbing)... Continue Reading →
Microsoft Mocking
As a .NET developer I don’t like using third party controls when there is tooling available from MS that will do the job I need. For example I prefer using the “baked in” MSTest suit as opposed to NUnit or MBUnit. The same is true for a mocking framework. I have tried with varying levels... Continue Reading →