I am making my first step in the development of test-driven with Visual Studio. I will start generic classes with VS 2010 Ask some questions about applying.
First of all, suppose I want to implement my version of my album. I started using the following tests (I'm using this case in MSTest):
[TestMethod] Public Zero Add_10_Items_Remove_10_Items_Check_Size_Is_Zero () {var myArrayList = New MyArrayList & LT; Integer & gt; (); (Int i = 0; i & lt; 10; ++ i) {myArrayList.Add (i); } For (int i = 0; i <10; ++ i) {myArrayList.RemoveAt (0); // What does it mean to remove extract or extract (t)? // VS Do not know any work around? } Integer = 0; Int real = myArrayList.Size; Extraordinary (Expected, real); }
I'm using VS 2010 capability to hit
Ctrl +
And it has implemented sections / methods on going.
- I'm having some difficulty while applying generic classes. For example, when I define a
.add (10)
method, VS If I intend to have a normal method (as the class is normal) is not known or add a(integer number)
method is there any way to differentiate it? - With the same kind of return, suppose that I am implementing a
mystacks
stack and I have to test that if I push and element and If I pop, then the stack is still empty. We all know that pop should return something, but generally, the code of this trial should not be cured for it. Visual Studio will then think that Pop is an invalid method, which is not really what one would like. How to deal with this? For each method, should I start by doing a test that is "very specific", as if it is clear that the method should be restored so that I do not get this kind of ambiguity? Even if I do not use the result, do I need something likeint popValue = myStack.opop ()
? - How should I test for general classes? Test with just one type of normal type? I am using
int
s, because they are easy to use, but should I also experiment with different types of things? How do you usually do this? - I know that is a popular tool, which is called a test named Drain. With the release of the VS 2010, is it still useful, or a lot of its features are now part of VS 2010, rendering it a bit useless?
- Whenever I define a new property in my test code, and to VS Asking that method to stop for me, it makes both a gator and a setter. If I have something like
integer value = MyClass.MyProperty
I want to understand that (at least yet) I only want to define a waiter.
Thanks.
I see that With the release of the VS 2010, is it still useful, or a lot of its features are now part of VS 2010, rendering it a bit useless?
This is useful because you use one of a number of different unit test structures (,,,, etc).
There are also other tools (like) that provide visual studio integration to run unit tests.
Comments
Post a Comment