Posted by Ramani Sandeep on August 18, 2013
Test Driven Development(TDD) is gaining momentum with each passing day. The reason for this is that with TDD we can not only built robust applications but also have a proof that the application is working correctly from a functional perspective by having successfully unit test cases on our modules. Also, the projects following agile/scrum methodology find TDD very useful because the major challenge in scrum is to define when our “done” is done. If we follow TDD approach then we know that when all our test cases are passed, we are done.
ASP.NET MVC application provide a very good support for TDD because we can write unit test directly against our controllers without needing any web server. Doing so we can be sure that the controllers are working correctly from a functionality perspective.
More info click here.
Hope this will help !!!
Posted in ASP.NET MVC | Tagged: TDD, Test Driven Development, Unit Testable Application Using ASP.NET MVC, Unit Testing | Leave a Comment »
Posted by Ramani Sandeep on May 19, 2013
As a WCF developer you always get question from interviewer : “Can we implement Inheritance in WCF ServiceContract?“
Answer will be:
YES we can have Contract Inheritance in WCF. In other words in WCF one ServiceContract can inherit other ServiceContract.
Let us take an example which explain us how to achieve it.
You have a ServiceContract named IParentService as given below :
public interface IParentService
string ParentMessage(string message);
Another ServiceContract named IChildService can inherit IParentService as following :
public interface IChildService : IParentService
string ChildMessage(string message);
Next you need to decide on implemention of Service. Single Service class can implement both contract by implementing bottom most ServiceContract in hierarchy. In this case bottom most ServiceContract is IChildService Service can be implemented as following in a single service class:
public class Service1 : IChildService
public string ChildMessage(string message)
return "Hello " + message + "from Child Service";
public string ParentMessage(string message)
return "Hello " + message + "from Parent Service";
Now you have choice that either you can expose whole hierarchy as single EndPoint or different EndPoints for different Service Contract. To expose contract hierarchy create EndPoint with bottom most ServiceContract. In this case we are creating EndPoint with Service Contract IChildService . At the client side operations from whole hierarchy could be invoked.
Hope this will help !!!
Posted in WCF | Tagged: Inheritance, Inheritance in WCF | Leave a Comment »