Why should one unit test MVC routes? [closed] - c#

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I see that people have ask more specific questions, but mine is broad, why should one test any routes at all? where does the benefit of this really shine? Thanks!
PS currently doing this in .Net C# MVC 3

Just my 2¢ to a very subjective question:
Because by unit testing your routes, a single key combination (that will run the unit tests) allows you to verify whether they behave as expected in contrast to running through your entire application and manually testing them by wasting enormous time and by potenatially forgetting to manually test some of the edge cases. Also when some other developer inherits the code base and starts modifying it, it is much easier for him to run this same key combination (that runs the unit tests) and get instant feedback whether his modifications didn't have some impact on the existing functionality rather than manually going through the entire application and clicking through all the links and stuff.
And from practical point of view I use MvcContrib TestHelper to unit test my routes.

Related

Hundreds of failing unit tests [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have inherited a very old (first commits are in 1999) code base and have found 500 of the 2000 or so unit tests to be failing. My question is, should I go through each test manually and check if it is still relevant or should I start over?
Nobody here can answer this as such, but you have to ask for each test:
Does this test still make sense? If not, remove it.
Is the test testing something that should work? Do something to fix it up.
Is the test conceptually useful, but what it tests has changed so it is now failing? Rewrite it so that it works in its new way.
How much effort to fix vs. value is the test? If it's a lot of effort, and low value, maybe remove it...
We can't really say whether you should do one thing or another.
It's probably worth just LOOKING at the tests, and especially looking at the effort of fixing the test before starting any real work.
You may also need to consult with some kind of test-manager for your group, and seek their input to the coverage/bug rate/common problems, etc for that part of the code.
When I look at old tests in our code base, it's sometimes best to remove, sometimes worth "fixing up" and sometimes worth starting from scratch. Unless you are familiar with the test, it's hard to say before you spend some effort on investigating the issue...

Is there any way to generate unit test automatically without Visual studio enterprise in c#? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am writing unit test for developed code I am using Visual studio ultimate 2013 is there any method to generate unit test automatically.
There is no way to have fully automatically generated tests in a test suite, however there are some test suites like IntelliTest that can generate code for you if you provide a description on what to test and how to test it.
However it will just be very basic stubs/tests that gets generated for you and you will have to write the meaningful tests on your own. The computer has no knowledge on what you want to test, which edge cases that needs to get covered and how extensive the testing should be.
There is no way to generate unit test automatically. You have to write unit test for developed code.

Integration Testing Framework [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a framework to help automate my integration tests. C# / VS2013.
The requirements are basically exactly the same as for a unit testing framework, except that I need to be able to specify the order that tests are executed in, because the tests are affecting a database (which is wiped at the start of the test and is always in a deterministic state throughout the tests) and gradually building up a very large number of products and other items which all interact with each other.
I'm currently using MbUnit / Gallio, but it seems like they've ceased development and can't launch VS2013 to debug. Is there anything else out there?
And I'm saddened by having to add this, but what I DO NOT NEED is people telling me how unit tests ought to be independent and mock the database layer. I've got unit tests, thanks. They don't give me enough coverage of some of the interactions I need to test, which is why I am automating integration testing in addition.
Visual Studio's unit test framework (mstest) has "Ordered Test" that will allow you to specify test execution order.
You can run tests in an order from command line through /testcontainer:test.dll /test:test1 /test:test2 /test:test3. Moreover the tests will run on alphabetical order.
maybe this links help ordered execution of tests in visual studio
There is also a design pattern described by martin fowler Gateway

How do you run your tests? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
When I was on my industrial year as part of my degree, I ran our FV tests using JUnit inside of Ant (scheduled build system).
I am wondering:
Is this the "norm"?
Are there any other ways people run there tests?
Please note this is regarding how people in large teams within organisations (test engineers) run there tests.
Edit: I used eclipse with IBM RTC.
Thanks.
You should look at Continuous Integration (CI). With tools like Jenkins, Hudson, TeamCity, you check in your code, then at a build server, your code is tested and reported for coverage and test results etc.
Also before any deployment your tests should run and pass with some criteria you define.
You can have unit tests, acceptance tests, end to end test, all these can be automated at a build server.
For large/enterprise applications, you should definitely use CI.

How to start fitnesse tests from ms test [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I can see that it can be done from JUnit,
I would like to run it from ms test framework instead.
It is probably very similar.
thanks
Kenneth
There is no FitNesse runner for MSTest at this time. The biggest hurdle is that the FitNesse test engine is written in Java and was therefore easier to integrate with JUnit. To do the same with MSTest would require porting significant portions of Java code to .NET. If there is widespread demand for this, open source developers may be encouraged to work on it.
I am/was thinking that the easiest would be to write a unit test suite, containing a testmethod that starts fitness up as in another process. I.e. run it from command line and getting the result from the output file.
not a ver unit testing way, since it is slow. It sound more like an integration test.

Categories