-->

21/01/2012

Unit Test Case writing for a MVC Project

In this post we will learn how to write Unit Test Cases for a MVC project.
One strong reason behind choosing MVC approach is TDD (Test Driven Development).

If we say my Data layer / Business Layer is 100% tested,it should pass all the positive scenarios and fail in all negative scenarios.
In order to do that, we need to write test cases for all the public methods present in different layers of our application and test them thoroughly.

I have created a very simple POC for demonstrating on how to write test cases.

16/01/2012

Behavioral Patterns - Observer Pattern

Lets not follow the text book definition of Observer Pattern.
Start with OO Principles.
OO Principle says, "Strive for loosely coupled design between objects that Interact".
Loose coupling brings the flexibility and resilience in system.

Lets take Facebook notifications as an example.
When there is any changes in my profile or wall , it will be automatically notified to my friends.
In this case, i am the subject and My friends are Observers. My friends list may vary. People may be added or removed from the list. But the system should be flexible enough to communicate the information despite of the change in observers list.

14/01/2012

Html.BeginForm() vs Ajax.BeginForm() in MVC3


We know that .BeginForm() extension method will create a form tag thus associating form level methods to the page.
I have been wondering what exactly is the difference between both Html.BeginForm() and Ajax.BeginForm() methods in MVC3.
Read many blogs, and everyone says only one thing, In Ajax forms, forms are submitted asynchronously using Javascript. So, this post is to verify the same thing.

10/01/2012

DateTime TryParse() and ParseExact() Methods

This Post is from a very good author James Michael Hare, We will look at a couple methods of the DateTime struct that give you additional control over parsing an input string into a DateTime.

Most of us have dealt with using DateTime.Parse() for these tasks, but sometimes you are wanting to parse something that may not be a valid DateTime, or may be in a non-standard format. So let’s look at the TryParse() and ParseExact() methods that can be used to deal with these two situations.

Basics of SAML


Before jumping into practical implementation of SSO, lets know the basics of SAML. 
SAML 
Security Assertion Markup Language (SAML) is an XML based framework developed by the Organization for the Advancement of Structured Information Standards (OASIS), used for the exchange of security information between different parties. This is an open standard that can be used to exchange security information between different products. 

History
# SAML V1.0 became an OASIS standard in November 2002. SAML V1.1 
# In September 2003 and has seen significant success, gaining momentum in financial services, higher
education, government, and other industry segments.
# In 2005, SAML V2.0 unifies the building blocks of federated identity in SAML V1.1 with input from higher
education's Shibboleth initiative and the Liberty Alliance's Identity Federation Framework.

05/01/2012

Sharepoint Coding Best Practices [MSDN]

This post is straight away from MSDN, but reason being, i found it very interesting and usefull while tuning the performance or while developing custom development projects.