检查Assert.assertTrue()方法是通过还是失败 [英] Check whether Assert.assertTrue() method is pass or fail

查看:3208
本文介绍了检查Assert.assertTrue()方法是通过还是失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查Assert.IsTrue()// Assert,AreEqual();方法在程序本身是通过还是失败因为基于那个



Im编写Mi测试用例使用Visual Studio 2010.因此在运行测试用例后没有报告。我们正在准备手动excel报告,以便我想将测试结果写入excel我想在编码部分本身检查此方法,或者是否有任何其他方法可以找到Assertion是True还是False ..

how to check whether Assert.IsTrue() //Assert,AreEqual();method is pass or fail in the program itself because based on that

Im writing Mi test cases Using Visual studio 2010. So there is no report after running the testcases . we are preparing manually excel report so that i want to Write the Test Results to excel i want to check this method in the coding part itself or is there any other way to find Assertion is True or False..

推荐答案

您必须在解决方案中添加Test Project类型的新项目,然后使用它自动为您的类生成单元测试(从VS Solution Explorer使用测试项目上下文菜单) - >添加新的单元测试),然后根据需要更改/自定义单元测试类(将生成),最后将测试项目作为启动项目并运行tests ==>测试报告文件。
You have to add a new project of type "Test Project" into your solution, then use it to automatically generate unit tests for your classes (from VS Solution Explorer use context menu over the Test Project -> Add new Unit Test), then change/customize the unit test classes (that will be generated) as you want, and finally make your test project as starting project and run the tests==> the test reports file.


这篇关于检查Assert.assertTrue()方法是通过还是失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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