nunit

Selenium waiting for AJAX in Chrome

南笙酒味 提交于 2019-12-11 05:34:48
问题 I've been using Selenium to automate website testing. Part of the tests involves waiting for AJAX requests to finish. I've been using this line to do that with jQuery 1.4: selenium.WaitForCondition("selenium.browserbot.getCurrentWindow().jQuery.active == 0", "5000"); It worked fine in Chrome and Firefox 4, but not IE9. Then I upgraded to jQuery 1.5, and it magically stopped working in Chrome. I've tried the following variations, but none of them work: selenium.WaitForCondition("selenium

Unit testing several different results in one method

孤街浪徒 提交于 2019-12-11 05:22:25
问题 I am using NUnit 2.5, and I want to test a method that recieves several parameters. Is it reasonable to try to test them using one Test method, with several different TestCases, or will it be harder to maintain (Or just pin point the exact failure) in the long run? My general idea is to try something like [TestCase("valid", Result="validasd", Description = "Valid string test, expecting valid answer")] [TestCase(null, ExpectedException = typeof(ArgumentNullException), Description = "Calling

NUnit: Could not load file or assembly 'some.dll' or one of its dependencies. The specified module could not be found

最后都变了- 提交于 2019-12-11 05:21:15
问题 I have a C++/CLI DLL that uses some C++ DLLs (both built for 32 bit). I want to test it within a C# DLL by using NUNit 2.5.8.10295 (changing to 2.6.4 did not change the outcome) I use a batch file which in the end gets expanded to this: nunit-console-x86.exe "someUnitTests.dll" /framework=4.0.30319 /xml=NUnitResult_someUnitTests.xml The tests run fine on my development PC (64-bit Win 10 Enterprise Visual Studio 2013) with this command. When starting nunit-console-x86.exe from Visual Studio

NUnit Test - Looping - C#

假如想象 提交于 2019-12-11 05:15:36
问题 I am new to TDD and trying to solve a problem. In my task, I have to read a bunch of strings from console and add them to a list of string type. In my test method, I have written a for loop to read strings and passing to a method to add. I don't know how to test this process, a bit confused. Any help will be appreciated. Thanks. Loop in the test method. for(int i=0;i<robot.noOfCommands;i++) { robot.readCommand(Console.ReadLine()); } I am writing code in C#.Net 回答1: Unit tests should never

Does c# have a rspec like testing framework that makes grouping like tests together?

坚强是说给别人听的谎言 提交于 2019-12-11 04:07:24
问题 I want a testing framework that makes it easier to group like tests together. I like how rpsec makes it easier to group similiar tests together, can you do this with any .net based framework? I'm using nunit at the moment. 回答1: Aren't you looking for NUnit Category attribute? http://www.nunit.org/index.php?p=category&r=2.2 来源: https://stackoverflow.com/questions/15839507/does-c-sharp-have-a-rspec-like-testing-framework-that-makes-grouping-like-tests

junit test results in tfs

人盡茶涼 提交于 2019-12-11 04:07:21
问题 How to make TFS 2010 show junit test results, that were generated by third-party tool? If it can't, probably, there is a way to convert junit report to xunit/nunit/mstest report. It would be also great! Thanks. 回答1: In order to publish Junit tests during TFS-Build you can make use of TFS Build Extension Power Tool. In there you can find a set of XSLT transforms from JUnit output into TRX. Employing TFS-Build to upload TRX should from then be possible. 来源: https://stackoverflow.com/questions

Using ShouldBeEquivalentTo and handling different names

自闭症网瘾萝莉.ら 提交于 2019-12-11 03:54:52
问题 I want to make a mapper test that maps a database model to a dto In the database model there is class Order { long Id } But on the Dto the same field is named class OrderDto { long OrderId } Using ShouldBeEquivalentTo how do I tell FluentAssertions that these fields are the same, but the name is different? 回答1: Its not exactly what you are asking for, but you can override the assertion comparison completely in fluent assertions for a given property with Using When. Its a little clunky and

Does Nunit TestCase attribute with Result property work incorrect?

女生的网名这么多〃 提交于 2019-12-11 03:22:14
问题 So, I wrote next "test" test :-) for Nunit 2.6 (use 2.6.0.12035 ver.) [TestCase(1, 2, Result = 3)] [TestCase(3, 4, Result = 7)] [TestCase(5, 6, Result = 11)] public int Add_Test(int a, int b) { return a - b; } Next, I run it with Resharper 6.1.37.86. Resharper shows that all three test are passed. Than I try to run test with nunit GUI - nunit.exe. Tests fall with strange error message: "Method has non-void return value". In fact all tests should fail with unexpected value of result. Does this

Asserting if a NameValueCollection is equivalent

时光毁灭记忆、已成空白 提交于 2019-12-11 03:19:47
问题 Does anyone know of a good way to assert if a NameValueCollection is equivalent? At the moment I'm using NUnit, but CollectionAssert.AreEquivalent() seems to only assert the keys. Not the keys and the values. I wrote this little piece of code to help me out, but it would be nice if there was something out-of-the-box that could do the same. private static void AssertNameValueCollectionAreEquivalent(NameValueCollection expectedCollection, NameValueCollection collection) { // Will evaluate keys

how to run visual studio or nunit as administrator from teamcity

自闭症网瘾萝莉.ら 提交于 2019-12-11 03:08:07
问题 I am currently running my tests using teamcity. Gaving the following error SetUp method failed. System.UnauthorizedAccessException : Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000- Any idea how can I set it to run as administrator as I am using windows 7. nunit teamcity watin share | improve this question 回答1: I also use TeamCity and WatiN. Here is what I did to make sure TeamCity can run as Administrator, but not as Local System (because it is better to