当前位置:网站首页>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边栏推荐
- Continuous learning of Robotics (Automation) - 2022-
- [team learning] [34 issues] scratch (Level 2)
- 机械臂速成小指南(十):可达工作空间
- Unity3d can change colors and display samples in a building GL material
- golang 根据生日计算星座和属相
- 案例大赏:英特尔携众多合作伙伴推动多领域AI产业创新发展
- Win11截图键无法使用怎么办?Win11截图键无法使用的解决方法
- Dab-detr: dynamic anchor boxes are better queries for Detr translation
- 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
- Zero knowledge private application platform aleo (1) what is aleo
猜你喜欢
史上最全MongoDB之安全认证
SSM+JSP实现企业管理系统(OA管理系统源码+数据库+文档+PPT)
Continuous learning of Robotics (Automation) - 2022-
Quick completion guide of manipulator (10): accessible workspace
Food Chem|深度学习根据成分声明准确预测食品类别和营养成分
2022 electrician cup question B analysis of emergency materials distribution under 5g network environment
数学分析_笔记_第10章:含参变量积分
The easycvr platform is connected to the RTMP protocol, and the interface call prompts how to solve the error of obtaining video recording?
Win11图片打不开怎么办?Win11无法打开图片的修复方法
Operational amplifier application summary 1
随机推荐
Redis源码学习(31),字典学习,dict.c(一)
ABAP 动态内表分组循环
Food Chem | in depth learning accurately predicts food categories and nutritional components based on ingredient statements
Restore backup data on GCS with br
Five years of automated testing, and finally into the ByteDance, the annual salary of 30W is not out of reach
Kotlin Compose Text支持两种颜色
pyqt5 失焦 监听无操作 定时器
Golang compresses and decompresses zip files
Digital chemical plants realize the coexistence of advantages of high quality, low cost and fast efficiency
Dab-detr: dynamic anchor boxes are better queries for Detr translation
Win11截图键无法使用怎么办?Win11截图键无法使用的解决方法
EasyUI export excel cannot download the method that the box pops up
The JSON format of the international area code of the mobile phone number is obtained with PHP
How to write a resume that shines in front of another interviewer [easy to understand]
VM virtual machine operating system not found and NTLDR is missing
How do test / development programmers get promoted? From nothing, from thin to thick
[system management] clear the icon cache of deleted programs in the taskbar
EasyCVR集群版本添加RTSP设备提示服务器ID错误,该如何解决?
Zero knowledge private application platform aleo (1) what is aleo
Mongo shell, the most complete mongodb in history