当前位置:网站首页>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边栏推荐
- 机械臂速成小指南(十):可达工作空间
- Mongo shell, the most complete mongodb in history
- 接口自动化测试实践指导(中):接口测试场景有哪些
- Different meat customers joined hands with Dexter to launch different hamburgers in some stores across the country
- Surpassing postman, the new generation of domestic debugging tool apifox is elegant enough to use
- ABAP Dynamic Inner table Group cycle
- Using thread class and runnable interface to realize the difference between multithreading
- 【OA】Excel 文档生成器: Openpyxl 模块
- Restore backup data on GCS with br
- leetcode 53. Maximum Subarray 最大子数组和(中等)
猜你喜欢
DAB-DETR: DYNAMIC ANCHOR BOXES ARE BETTER QUERIES FOR DETR翻译
[OA] excel document generator: openpyxl module
buildroot的根文件系统提示“depmod:applt not found”
Storage of data
测试/开发程序员怎么升职?从无到有,从薄变厚.......
Mongo shell, the most complete mongodb in history
2022中青杯C题城市交通思路分析
【刷题记录】2. 两数相加
各路行业大佬称赞的跨架构开发“神器”,你get同款了吗?
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
随机推荐
[ArcGIS tutorial] thematic map production - population density distribution map - population density analysis
The JSON format of the international area code of the mobile phone number is obtained with PHP
DAB-DETR: DYNAMIC ANCHOR BOXES ARE BETTER QUERIES FOR DETR翻译
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
AI 落地新题型 RPA + AI =?
POJ training plan 2253_ Frogger (shortest /floyd)
Continuous learning of Robotics (Automation) - 2022-
接口自动化测试实践指导(中):接口测试场景有哪些
NanopiNEO使用开发过程记录
用头像模仿天狗食月
CUDA Programming
PHP implements lottery according to probability
pyqt5 失焦 监听无操作 定时器
SSM+JSP实现企业管理系统(OA管理系统源码+数据库+文档+PPT)
2022中青杯数学建模B题开放三孩背景下的生育政策研究思路
Formation continue en robotique (automatisation) - 2022 -
Unity3d can change colors and display samples in a building GL material
Hangzhou Electric 3711 binary number
案例大赏:英特尔携众多合作伙伴推动多领域AI产业创新发展
The most complete learning rate adjustment strategy in history LR_ scheduler