Samstag, 9. Mai 2009

Moq and abstract classes

Today i experimented a little bit with moq and abstract classes.

Lessons learned:

- It is possible, to mock abstract classes and usual classes, it is impossible, to mock sealed classes.
- Only abstract and virtual methods can be mocked.
- Properties can be mocked the following way


public abstract class Entity
{
public abstract int Id { get; protected set; }
}

...
var mock = new Mock<Entity>();
mock.SetupProperty(entity => entity.Id, 5);

Montag, 23. Februar 2009

First steps with ruby

Today i did my first steps with ruby. I stepped through the 20 minutes tutorial, and i wonder, wether it is possibly, to overload functions in ruby.

My first lines were like this:

def hello
puts "hello"
end

def hello(name)
puts "hello #{name}"
end

hello
hello("Jens")


It turned out, that ruby only knew the second definition of hello, the first one, without parameters, seems to be overwritten.

On the other hand, it is quite simple to write unit tests, see Unit Tests with ruby.

My development tools

As i will write about my developing experiences in this blog, i should mention my used tools. These are the tools i use at home, also i will only write about experiences made with private projects. Don´t wanna mix personal and professional life, do we?

Tools i use on a regular basis:
  • Visual C# Express
  • Visual Web Developer Express
  • SQL Server 2008 Express
  • NUnit
  • MOQ
  • Notepad++
  • TortoiseSvn
Tools i already installed, but which i should use more often or still have to learn:
  • Ruby
  • F#
  • SharpDevelop 3
  • Powershell
  • FreeRide
  • PostSharp
  • Machine.Specification
  • Hudson
  • FxCop
  • StyleCop

Freitag, 20. Februar 2009

My first blog entry

Today i enter the world of the bloggers. What do i expect from blogging? As mentioned in "Pragmatic Thinking & Learning" it is just a great opportunity to write about several topics and share my thoughts.