是否可以将现有的[AssemblyInitialize]与通用测试一起使用 [英] Is it possible to use existing [AssemblyInitialize] with Generic Tests

查看:95
本文介绍了是否可以将现有的[AssemblyInitialize]与通用测试一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些针对本地ASP.NET Web服务器执行的单元测试。  我有启动/停止ASP.NET服务器的TestInit和Class Inits。  我想使用此功能确保本地网络服务器在
之前运行,以启动我的通用测试


 


背景: 我正在使用Selenium Server在我们通过VS2010开发的网络应用程序中从命令行(使用java引擎)运行一些UI测试。


 


谢谢!

解决方案

eric_pelletier,


< h1> AssemblyInitializeAttribute类

标识一个方法,该方法包含在程序集中的所有测试运行之前要使用的代码,并分配程序集获取的资源。


 


只要您的第三方测试被正确包装为通用测试,那些测试将成为测试程序集的一部分,并且会受到AssemblyInitialize属性的影响。


 


干杯,


Paul 


 


I have some Unit tests which are being executed against the local ASP.NET Web server.  I have TestInit and Class Inits that will start/stop the ASP.NET server.  I'd like to use this functionality to ensure that the local web server is running prior to having my Generic Test start up

 

Background:  I am using Selenium Server to run some UI tests from the command line (using the java engine) on our web app that is developed via VS2010.

 

Thanks!

解决方案

eric_pelletier,

AssemblyInitializeAttribute Class

Identifies a method that contains code to be used before all tests in the assembly have run and to allocate resources obtained by the assembly.

 

So long as your third party tests are properly wrapped as generic tests, those tests will be part of your test assembly and will be affected by the AssemblyInitialize Attribute.

 

Cheers,

Paul 

 


这篇关于是否可以将现有的[AssemblyInitialize]与通用测试一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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