Posts Tagged ‘C#’

Types in .Net - Part 1

Tuesday, April 22nd, 2008

Types in .Net - Part 1

There are primarily two types in .Net:
- Value types
- Reference types.

In this article we will be focusing on Value Types. All Numeric types, Boolean type, Character type etc.. are Value types. .Net framework 2.0 has more than 300 value types. We will be looking at only a few if them. The Numeric Types are used frequently so the C# language as well as VB.Net language provided aliases for them. The following is a partial list of the available Value types in .Net Framework 2.0.

- System.SByte
- System.Byte
- System.Int16
- System.Int32
- System.UInt32
- System.Int64
The above 6 Value types are used for Whole numbers.

- System.Single
- System.Double
- System.Decimal
The above 3 Value types are used for floating point numbers.

- System.Char
- System.Boolean

Value types have a implicit constructor so declaring them instantiates them, no need of using the ‘new’ keyword.

We will cover Nullable’s, User Defined Value Types and Enums in future articles.

Types in .Net - Part 1

TDD - Test Driven Development - An Introduction

Wednesday, April 2nd, 2008

TDD - Test Driven Development - An Introduction

TDD - Test Driven Development.
First of all what is TDD ? TDD is writing test cases while developing.

How is it important ?
You write the code, you write the test cases and see that all test cases pass. Now when you modify some code, you can just run these test cases and see that there are no breaking changes. Though time consuming, worth the time.

What tools do you have for .Net developers ??
Here is a list of free tools / tools which have a free version.
1) Moq - Moq is the only mocking library for .NET developed from scratch to take full advantage of .NET 3.5 (i.e. Linq expression trees) and C# 3.0 features (i.e. lambda expressions). It supports mocking interfaces as well as classes.

2) Rhino Mocks - Rhino Mocks’ purpose is to ease testing by allowing the developer to create mock implementations of custom objects and verify the interactions using unit testing.

3) MbUnit - Extensible unit testing framework that extends classic frameworks such as NUnit and csUnit by providing a variety of new specialized test fixtures. Developpers can even defined their own new fixtures.

4) NUnit - Unit-testing framework for all .NET languages.

5) White - Windows application automation. White supports rich client applications: Win32, Windows Forms and WPF.

6) Ranorex - Windows GUI test and automation library.

7) Watin - WatiN (Web Application Testing In .NET) allows you to automate Web application testing with Internet Explorer.

8) TestDriven.Net - Unit testing add-in for Visual Studio .NET.

9) xUnit.net - Unit testing framework.

This may not be a complete list, If I missed something please let me know through comments. Out of this list I would prefer NUnit and MbUnit.

In a future articles I will go over TDD in more detail.

TDD - Test Driven Development - An Introduction

FastSharp - Another Code Snippet Compiler

Tuesday, February 12th, 2008

FastSharp - Another Code Snippet Compiler

I posted about Snippet Compiler a nice little handy tool. Here is another similar tool worth checking out.

FastSharp is a text editor which lets you compile and run C# code that would normally exist inside a method.

Download the Source Code and Binaries here.

FastSharp - Another Code Snippet Compiler


Books 24x7