nunit

Best way to unit test console c# app

▼魔方 西西 提交于 2019-12-30 01:19:06
问题 I have a simple console app. It's fired of with a normal main and the entire program recides in main. It uses the Command Line Parser Library. Then I have a second project in the solution containing unit tests for the application. But I don't seem to find a good way to start processes of the main program from the tests. My current code for actually start the process looks something like this. ... process = new Process(); process.StartInfo.FileName = "FooBar"; process.StartInfo.Arguments =

NUnit extension

孤街醉人 提交于 2019-12-29 08:43:06
问题 Hi All i have a question regarding NUnit Extension (2.5.10). What i am trying to do is write some additional test info to the database. For that i have created NUnit extension using Event Listeners. The problem i am experiencing is that public void TestFinished(TestResult result) method is being called twice at runtime. And my code which writes to the database is in this method and that leaves me with duplicate entries in the database. The question is: Is that the expected behaviour? Can i do

Selenium 2.0 WebDriver Advcanced Interactions DoubleClick Help (c#)

给你一囗甜甜゛ 提交于 2019-12-29 07:42:23
问题 So within my selenium regression tests, I've been trying to double click on a calendar to make a new appt. I have attempted to use the doubleClick(); method within the advanceduserinteractions library, but there is an issue; the two clicks aren't fast enough/close enough together to fire an actual double-click! Has anybody found a way to deal with this in their testing? 回答1: This code works for me! Actions action = new Actions(driver); action.doubleClick(myElemment); action.perform(); 回答2:

Selenium 2.0 WebDriver Advcanced Interactions DoubleClick Help (c#)

戏子无情 提交于 2019-12-29 07:42:11
问题 So within my selenium regression tests, I've been trying to double click on a calendar to make a new appt. I have attempted to use the doubleClick(); method within the advanceduserinteractions library, but there is an issue; the two clicks aren't fast enough/close enough together to fire an actual double-click! Has anybody found a way to deal with this in their testing? 回答1: This code works for me! Actions action = new Actions(driver); action.doubleClick(myElemment); action.perform(); 回答2:

Selenium 2.0 WebDriver Advcanced Interactions DoubleClick Help (c#)

狂风中的少年 提交于 2019-12-29 07:42:08
问题 So within my selenium regression tests, I've been trying to double click on a calendar to make a new appt. I have attempted to use the doubleClick(); method within the advanceduserinteractions library, but there is an issue; the two clicks aren't fast enough/close enough together to fire an actual double-click! Has anybody found a way to deal with this in their testing? 回答1: This code works for me! Actions action = new Actions(driver); action.doubleClick(myElemment); action.perform(); 回答2:

NUnit: Accessing the Failure Message in TearDown()

左心房为你撑大大i 提交于 2019-12-29 07:14:14
问题 I'm trying to log the results of automated tests run in NUnit in a small database so that data is easily accessible and more securely logged for various reasons. (There's about ~550 automated tests and running them all can take days) I already have access to the ending status of the test (Passed/Failed/Error/Cancelled/Skipped etc..) but I'd like to log the extra detail. I am looking to do this within TearDown(). This is the closest thing I could find, but did not provide me with an answer:

Adding NUnit to the options for ASP.NET MVC test framework

天大地大妈咪最大 提交于 2019-12-29 03:25:09
问题 I have nUnit installed. I have VS2008 Team Edition installed. I have ASP.Net MVC Preview 4 (Codeplex) installed. How do I make Visual Studio show me nUnit as a testing framework when creating a new MVC project? At this point I still only have the Microsoft Testing Framework as a choice. Update: I installed nUnit 2.5, but still with no success. From what I've found Googling, it would seem I need to create templates for the test projects in order for them to be displayed in the "Create Unit

NUnit Test Run Order

亡梦爱人 提交于 2019-12-28 08:06:06
问题 By default nunit tests run alphabetically. Does anyone know of any way to set the execution order? Does an attribute exist for this? 回答1: Your unit tests should each be able to run independently and stand alone. If they satisfy this criterion then the order does not matter. There are occasions however where you will want to run certain tests first. A typical example is in a Continuous Integration situation where some tests are longer running than others. We use the category attribute so that

Unit testing the app.config file with NUnit

北城余情 提交于 2019-12-28 04:59:10
问题 When you guys are unit testing an application that relies on values from an app.config file? How do you test that those values are read in correctly and how your program reacts to incorrect values entered into a config file? It would be ridiculous to have to modify the config file for the NUnit app, but I can't read in the values from the app.config I want to test. Edit: I think I should clarify perhaps. I'm not worried about the ConfigurationManager failing to read the values, but I am

Events not firing from COM component when in Unit (Integration) Test

有些话、适合烂在心里 提交于 2019-12-25 09:14:28
问题 I have an unmanaged DLL which I'm trying to create a .NET wrapper library for but am getting different behavior when I try and run a NUnit(v3) test over it compared to if it is just run from a button click off a WinForm app. Background: During startup of the DLL I call its Connect() method, which ultimately causes the DLL to make a TCP connection. When the TCP connection is established I then get notified by wiring up a handler to its "Connected" event. Once connected I then call other