Setting up MbUnit for ASP.NET MVC - asp.net-mvc

I am using Visual Web Developer 2008 Express with ASP.NET MVC 1.0.
I would like to use MbUnit as a test framework so how would I set this up as a unit test project for an ASP.NET MVC web application?

File -> New -> Project -> Windows -> Class Library
Add a reference to MbUnit.dll (or whatever the name of their library is)
Add a reference to your ASP.NET MVC project
Add a new class file and your test code
The only problem you'll run into now is running the tests. For that you might try something like TestDriven.net or ReSharper.
FYI The latest nUnit includes the features that MbUnit set out to add to unit testing. nUnit also has better integration with VS and various add-ons I believe.

Related

Updated ASP.NET Web Application (.NET Framework) MVC5 Project Template

The project that visual studio 2019 creates for an ASP.NET Web Application (.NET Framework) MVC5 comes with Bootstrap 3.x and many other outdated components. Not to mention unneeded things like modernizr.
If you update Bootstrap, you know need to modify the ScriptBundle in BundleConfig to get the application to start, and then modify the CSS to get the premade web pages to render properly.
Also, the folder structure is not the best.
Is there a project template out there that has all essential components updated, and a clean-up NuGet and folder structure?
I tried using Rider but they do not have a built-in template.
I went t the .Net Foundation GitHub and did not find any: https://github.com/dotnet?q=.NET+framework&type=&language=c%23&sort=
I also search GitHubub and did not see any: https://github.com/search?q=ASP.NET+Web+Application+%28.NET+Framework%29+project+template
I am looking for a project template that has the basic structure to create a Clean Architecture in .NET Framework and not .NET Core
I know it's legacy, but unfortunately, I need it for a university class (University courses take a while to get updated, and in this case, they claim that there are sufficient companies out there using ASP.NET MVC 5 to Merrit them teaching it) But yes, No one should be using this to start a new project they intend to put into a real-life production scenario.
Thank you

Adding Custom Refrence for ASP.Net MVC on Visual Studio Code

We are developing an ASP.Net MVC project and some of my co-workers are working on Mac OS. I have installed Visual Studio Code and ASP.Net Helper along with the C#. I have copied the whole project to Mac but the problem is it is not seeing my project refrence file, let's say MyProject.dll. When i add it on the Windows with generic VS, IntelliSense is completing automatically bringing the functions that i wrote.
All i need is adding a refrence and using IntelliSense for my functions on VisualStudio code. Is there anyway to achive that?
Visual Studio Code doesn't support ASP.NET MVC projects. You can load them and view files but you will not be able to use Intellisense, build or debug such projects. If you want your co-workers to use VS Code as the IDE under Mac consider migrating your project to ASP.NET Core.

NUnit Testing Framework for MVC 3 Projects

I am using Visual Web Developer 2010. I have installed NUnit, and I'm trying to get it so that NUnit is a selectable testing framework when you create an ASP.NET MVC 3 project.
Since I am using Visual Web Developer, I do not have access to MSTest. What do I need to do to get NUnit loaded as a Test Framework so I can add it as a project based off of a template when I create an MVC 3 project?
You may checkout the following template. It's for VS2010 Professional and higher since VWD 2010 do not support extensions.

how to add mvc test project to upgraded web application

I have an existing asp.net web application that I'm updating to include some MVC pages. I have successfully upgraded the web app to recognize my MVC controllers/views/... I can even get my test page to display correctly: hooray!
However, I am having trouble figuring out how to add a test project so that I can add my unit tests for the new pages. Does anyone have a suggestion on how to achieve this goal?
If you are using MSTest right click on the solution and Add -> New Project.... Select Test Project type. In the newly created project reference the project containing the controllers and start adding unit tests.
If you are using some 3rd party unit testing framework such as NUnit you could add a project of type Class Library and then add the unit tests to this class library.

When starting a MVC project, no Test project is created

When creating a new MVC Project in VS2008 Professional (SP1 installed), I do not get prompted for a Unit Test project.
I have searched and found this solution (Creating new ASP.Net MVC project - Unit Test Dialog does not show up) BUT I have already installed the Testing Tools and still no Unit Test dialogue appears.
Any ideas?
I ended up formatting my pc, reinstalling Windows 7 and VS08 SP1 and MVC
Ultimately, the unit test project that is automagically added is just a class library project with the proper references added. Instead of worrying why the dialog doesn't pop up, add a class library project to your solution that references your testing framework. You'll end up with the results you want.

Resources