C# has an object called WebClient that makes it easier to execute POSTs and GETs. However, if you ever have to deal with managing cookies, the WebClient doesn't do this out of the box, which puzzles me. It's not too hard to implement though.
In reworking some code, I wanted to leverage some lazy loading goodness for properties of a class. Yet at the same time, return a list of all those properties for iterating. Reflection is an awesome way to accomplish this feat!
Using an Oracle database backend in conjunction with LINQ required use of a 3rd party tool called DevArt dotConnect for Oracle. However, when the database model is configured, it's hard coded to a specific database instance (Dev, Test, etc). I wanted to dynamically select which database instance to run against relative to the lane my tests were running against. It's actually easier than I thought.
In running functional automation testing, it has always been difficult to know whether the AJAX call has finished. Most people just put a Thread.Sleep() in the code, but it clutters up things and isn't accurate. To handle this appropriately, we found a way to watch for those JQuery AJAX calls and drive the automation accordingly.
Usually when you mention "adding comments to your code" or "make sure you document it", it gets pretty ugly and the security guards are called in to restore order. Okay, maybe not that intense but you would have to agree that it's not a fun task.
In NUnit, you can specify a category on a test method or test fixture. I needed that list in a totally different context. Here's how to do it.
We have a custom object called ListOption in our code. It holds category, value and option and fairly represents the basics of a single SelectList item. To hold the ListOption values, the primary developer stored this List as and IList instead of an ArrayList or any other concrete type. OptionList extends IEnumerable
Here is how I sorted the IList.
The CategoryAttribute can be used to specify additional groupings of test cases that you want to run at the same time. For example, we have our test cases split up into level of priorities (Level 1, Level 2, Level 3). Here's how you can do it:
With a couple thousand tests, the email can be pretty big when viewing the results. We decided we only wanted the high level summary rather than the nitty gritty details.
One of the applications I am testing deals a lot with finance information. However, since most of the data is stored in a remote database, I can't collect or check all the data I want to. We only store a fraction of this information in our schema. I had the wsdl files from the finance department in order to make web service calls. Here's how I did it.
I was trying to automate some tests that included a PDF loaded inside an IE 7 window. Using conventional methods, I could not attach to this new window, thus couldn't control whether it was done loading, or close it for that matter.
On our project at work, I am experimenting with some lambda and linq expressions. It's been kind of fun except for the road-block I hit.