ApplicationContext.Current is always null while I am trying to write my integration tests.
Dear All,
Now I am trying to create my integration tests on my system.
For example:
I would like to insert a member to the data base using IMemberService service and then I will check if the member has been inserted or not -> test succeeds.
When I try to use ApplicationContext.Current in my tests which is written in MS Test and Coded UI frameworks it fails completely because always ApplicationContext.Current is null.
Any ideas how can I get ApplicationContext.Current running in a UnitTest project or CodedUI project or even dll library without the need to run the website?
ApplicationContext.Current is always null while I am trying to write my integration tests.
Dear All,
Now I am trying to create my integration tests on my system.
For example:
I would like to insert a member to the data base using IMemberService service and then I will check if the member has been inserted or not -> test succeeds.
When I try to use ApplicationContext.Current in my tests which is written in MS Test and Coded UI frameworks it fails completely because always ApplicationContext.Current is null.
Any ideas how can I get ApplicationContext.Current running in a UnitTest project or CodedUI project or even dll library without the need to run the website?
Any thoughts?
OK.
I found how to do this using Web API
Here is the Web API
And here is the Consumer of the Web API
Then I can use the consumer directly from any class in my tests like this:
Please, if any administrator can solve the coloring issue of the code. This would be nice. Thanks.
is working on a reply...