当前位置:网站首页>Unit test asp Net MVC 4 Application - unit testing asp Net MVC 4 apps thoroughly
Unit test asp Net MVC 4 Application - unit testing asp Net MVC 4 apps thoroughly
2022-07-07 04:24:00 【Technology feast】
problem :
I realize this is a duplicate of about 20 different posts, but none of them are specific to MVC4, and none that I've seen really answer all of my questions. I realized it was about 20 Repetition of different posts , But none of them MVC4 Peculiar , All the posts I have seen have not answered all my questions .So far my first foray into the world of TDD has been frustrating to say the least. up to now , My first foray TDD The world is at least depressing .Most of what I've tried to do seems incompatible with MVC 4 or next to impossible without using poorly documented third party libraries I don't quite understand yet. Most of what I try to do seems to be related to MVC 4 Are not compatible , Or if a third-party library with incomplete records is not used , I don't quite understand .
What I want to be able to do, is write a tests that will test my Controller Actions, The Model they're passing and The View the action is sending the model to. What I hope to do is write a test to test my controller action , They pass on models and see Action is sending model .I want to test if the view exists, I want to test if the model being passed is the right type for the view, I'd like some way to test if it will process properly. I want to test whether the view exists , I want to test whether the passed model is the correct type of view , I want some ways to test whether it will handle properly .I also want to be able to test my routes. I also hope to test my route .And testing Authentication filters? And test and verify the filter ?
I want a way to unit test ASP.Net MVC that will leave very little to chance. I want a way to ASP.Net MVC Unit test , This method has little chance .
Testing the Model output of an Action seems easy enough, but testing the views has been next to impossible. test Action Of Model Output seems easy , But testing the view is almost impossible .
So here's my list of questions: So this is my list of questions :
- Once I test the action and get the action result, how do I test to see if the view it wants exists? Once I test the action and get the result , How can I test to see if the view it wants exists ?
- How do I test my routes? How do I test my route ?
- How can I test to be sure my views are being processed properly? How do I test to ensure that my point of view is handled correctly ?
- What is really "best practice" for THOROUGH unit testing of ASP.Net MVC 4? What is? ASP.Net MVC 4 Of THOROUGH Unit testing is really “ Best practices ”?
- How do I unit test forms authentication? How to perform unit test form authentication ?
- How do I unit test Action Filters? How to unit test the action filter ?
I'd prefer to use the built in Visual Studio test projects, but if I must use NUnit, I must. I prefer to use built-in Visual Studio Test project , But if I have to use NUnit, I have to do this .I just need to make sure it gets done properly. I just need to make sure it's done correctly .
Thank you in advance for your responses. Thank you in advance for your reply .
EDIT: I also couldn't get NUnit working with my MVC4 app because of some incompatibly with the version of .NET one of the assemblies was compiled in. edit : I can't let NUnit Use my MVC4 Applications , Because some software is related to .NET Version incompatible .
Solution :
Reference resources : https://stackoom.com/en/question/cgne边栏推荐
- [on automation experience] the growth path of automated testing
- The JSON format of the international area code of the mobile phone number is obtained with PHP
- Zero knowledge private application platform aleo (1) what is aleo
- Golang compresses and decompresses zip files
- ABAP Dynamic Inner table Group cycle
- CUDA Programming
- [OA] excel document generator: openpyxl module
- easyui出口excel无法下载框弹出的办法来解决
- Pyqt5 out of focus monitoring no operation timer
- Why does WordPress open so slowly?
猜你喜欢

SSM+JSP实现企业管理系统(OA管理系统源码+数据库+文档+PPT)

Win11控制面板快捷键 Win11打开控制面板的多种方法

Ssm+jsp realizes enterprise management system (OA management system source code + database + document +ppt)

Win11截图键无法使用怎么办?Win11截图键无法使用的解决方法

Operational amplifier application summary 1

CUDA Programming

Optimization of channel status offline of other server devices caused by easycvr cluster restart

Win11图片打不开怎么办?Win11无法打开图片的修复方法
![[coded font series] opendyslexic font](/img/5e/e1512ffe494b5d0e7d6d6765644126.png)
[coded font series] opendyslexic font
![[team learning] [phase 34] Baidu PaddlePaddle AI talent Creation Camp](/img/eb/9aed3bbbd5b6ec044ec5542297f3c6.jpg)
[team learning] [phase 34] Baidu PaddlePaddle AI talent Creation Camp
随机推荐
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
[system management] clear the icon cache of deleted programs in the taskbar
ABAP 動態內錶分組循環
Nanopineo use development process record
True global ventures' newly established $146million follow-up fund was closed, of which the general partner subscribed $62million to invest in Web3 winners in the later stage
The JSON format of the international area code of the mobile phone number is obtained with PHP
[untitled]
Learn how to use js to merge two objects into one object assign()
See Gardenia minor
Different meat customers joined hands with Dexter to launch different hamburgers in some stores across the country
EasyCVR视频广场点击播放时,主菜单高亮效果消失问题的修复
Formation continue en robotique (automatisation) - 2022 -
2022年电工杯B 题 5G 网络环境下应急物资配送问题思路分析
Unity3d can change colors and display samples in a building GL material
ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly
【编码字体系列】OpenDyslexic字体
Some thoughts on cross end development of kbone and applet
史上最全MongoDB之初识篇
Redis源码学习(30),字典学习,dict.h
Mysql-数据丢失,分析binlog日志文件