Skip to content

Category Archives: C#

Mocks versus stubs and fakes

12-Oct-09

I dislike using mocks I dislike using dynamic mocking/stubbing frameworks. because it means my tests have an extra dependency beyond just the SUT (System Under Test). I often find myself spending more time getting the mock to work correctly rather than my app code. The lambada + generics based Mock suites (Moq, RhinoMocks, etc), [...]

JavaScript: Not for the faint at heart?

13-Aug-09

JavaScript: A tool too sharp?
Script# (Script Sharp) – writing javascript in C#
Both Jimmy and roy have great posts discussing JavaScript. Roy is looking at it as a C# developer lured by the many, many articles about how jQuery is the only thing that makes JavaScript worth using and using Script# to abstract away some of [...]

Declaration of Awesomeness for the Mono Compiler

23-Feb-09

MonoDevelop 2.0 Beta 1 - Miguel de Icaza
Now, technically speaking we have not received any awards for our C# 3.0 compiler, but we should have, because we are awesome. And in fact, I will be arranging a dinner at my place this coming weekend where we will award prizes to the best pieces of technologies [...]

Mocking IDataReader using Rhino.Mocks 3.5

12-Dec-08

The other day I was writing unit tests for some legacy code and I needed to mock IDataReader. I really just wanted to populate the reader with a single row of data, then the Read() method should return false. Using Rhino.Mocks it was a piece of cake.
PLAIN TEXT
CODE:

IDataReader reader = MockRepository.GenerateStub<IDataReader>();

 

          [...]

Dynamic Lookup in C# 4

04-Feb-08

Charlie Calvert's Community Blog : Future Focus I: Dynamic Lookup: ""
Charlie Calvert is discussing a new feature in C# called dynamic lookup
The next version of Visual Studio will provide a common infrastructure that will enable all .NET languages, including C#, to optionally resolve names in a program at runtime instead of compile time. We call [...]

Adding values to the DataGridViewComboBoxCell at runtime

12-Sep-06

Welcome to hackville population me.
The DataGridViewComboBoxCell won't allow values to be entered in the cell if they are not in the Items collection. Since I can't modify the Items collection if the DataSource property is set, I add value of the cell that's causing the DataError to the DataSource for the combo box. Since [...]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes