VS单元测试以Web页面为参数调用类的方法 [英] VS unit Testing for the method which invoke class with Web page as parameter

查看:155
本文介绍了VS单元测试以Web页面为参数调用类的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我需要为类A中的公共方法编写VS单元测试。

ClassA没有默认构造函数,它具有参数化构造函数;参数为网页。

为了编写方法的VS单元测试,我们需要通过传递网页创建网页并创建实例,并为公众编写。我的问题是如何创建网页并通过?



请帮助这个



注意:

在参数化构造函数中,代码如下所示,

- Wepage.Mappath

- webpage.Request.Url





谢谢,

Kamal

Hi,

I need to write a VS unit testing for the public method which present in the classA.
ClassA dont have default constructor, it is having parameterzed constructor; parameter as Web Page.
As to write VS unit testing for the method, we need to create web page and create instance by passing the webpage and write for the public. My question here is how to create web page and pass?

Kindly help on this

Note:
In the parameterzed constructor, the code written like below,
- Wepage.Mappath
- webpage.Request.Url


Thanks,
Kamal

推荐答案

这篇关于VS单元测试以Web页面为参数调用类的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆