c# - How do I tell when I need to write my own Interface and Wrapper for unit testing? -


I am still confused when I have to make cover and interface for my tests.

As I read about MVC in a book, the author uses the Mac Framework.

Then the author creates an IFormAuthentication interface first.

There are a few ways to write and then a rappelling code that implements the actual code for these methods and methods (i.e. signout).

Then he uses the interface in Moq. So I understand it, but if I'm wrong then correct me.

He is doing this because he wants to make fake textures using the interface. Then in the MVC application they have taken this step that if the interface is zero then it will create a new cover class.

That's why I'm guessing that when it actually uses the time cover to run, really the real methods are included so that the application will work as much as it should.

So hopefully I got this right.

Now he goes to the people with the membership and he says something like "Look how many ways I have to apply with an interface (I'm also guessing that he will also make a cover ) ".

Instead we will get the muke to do it and then it passes through the muke subscription provider and it produces all things.

So my questions are how do they know? It is on one side that you can not do the form accummulation method in this way, but what can you do to the membership provider?

I also do not think you can do this with membership that it is a subscription provider.

So where do I get this information? Like I want to do my SMTP and I want to know that I have to write the interface and then cover or I can work as a subscription provider?

I'm not sure that I don ''

Removing an interface because it is already an abstract class, so it already works excellent as a test double. In other words: Removing an interface is only necessary if you are a class outside your control, you can create an adapter that wraps the actual implementation, while still testing the double With the ability to change the actual implementation.

When allocations, interfaces and virtual members are perceptually equivalent.

You can read more about Test Doubles in excellent.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -