nunit

How to test Framework if Unit tests are in separate assembly?

不羁的心 提交于 2019-12-11 08:04:23
问题 I have assembly with my framework and assembly with tests. But I need to test internal classes or substitute some services. For example, - I need to test internal helper. - My framework read and analyze files created by other application. I create these files manually for tests. But I can't give it to my framework from separate assembly. I need to create mock for internal service to provide these files. 回答1: If You want Your internal classes to be visible to your tests You must make your test

Using IoC container as a service locator for HttpHandler

落爺英雄遲暮 提交于 2019-12-11 07:28:45
问题 This question relates to my other post. Ok so after a bit more messing around I decided to do it this way. Which seems to work fine when I run it, although I'm getting the following error in NUnit: Could not load file or assembly 'Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) So not sure what is happening there???

How get javascript log using Selenium on NUnit test?

前提是你 提交于 2019-12-11 07:25:40
问题 I'm trying to retrive Javascript console logs from NUnit test on Visual studio using Selenium ChromeDriver but i get a null value on Logs. I have tried the code below but it will give a Null point reference on "driver.Manage().Logs.GetLog(LogType.Browser);". I'm using last version of ChromeDriver v75. options.SetLoggingPreference(LogType.Browser, LogLevel.Warning); var driver = new ChromeDriver(options); driver.Navigate().GoToUrl("http://stackoverflow.com"); var entries = driver.Manage().Logs

How to change the visibility of the button got by Xpath in Selenium

孤街浪徒 提交于 2019-12-11 07:12:58
问题 Hello I am working in Selenium Automation testing with Nunit. I have one grid which have bulk of users and there is one remove button on each row of the grid. But that Remove button is visible only on mouse hover. So when I run the script, It gives me the error - Element is not currently visible and so may not be interacted with The Xpath of button is "//div[1]/div[2]/div/section/div[2]/div[contains(.,'IE8 john smith')]/div/div[2]/button[1]" I tried working with the actions in selenium but

Bamboo Nunit parser task incorrectly parses the results from nunit3-console.exe (25 tests were quarantined)

风流意气都作罢 提交于 2019-12-11 06:56:59
问题 In Bamboo plan I have script-task, where script body is: @echo off SET nucpath=%1 SET projectvar=%2 SET xmlvar=%3 CALL SET xmlvar=%%xmlvar:-xml=--result%% SET outputvar=%4;format=nunit2 SHIFT SHIFT SHIFT SET remvar=%2 :loop SHIFT if [%1]==[] GOTO afterloop SET remvar=%remvar% %2 GOTO loop :afterloop REM Ensure PATH includes nunit3-console.exe or edit the line below to include full path. %nucpath% %projectvar% %xmlvar% %outputvar% %remvar% with arguments: ${bamboo.build.working.directory}\src

Cannot run nunit tests with Nant

≯℡__Kan透↙ 提交于 2019-12-11 06:44:02
问题 I'm trying to launch nunit ui tests with nant and get the error: Buildfile: file:///c:/UItests/nant.build Target framework: Microsoft .NET Framework 4.0 Target(s) specified: build build: [nunit2] 2012/06/20/13:29:52: Exception in set up method: The CurrentThread needs to have it's ApartmentState set to Apar tmentState.STA to be able to automate Internet Explorer. [nunit2] 2012/06/20/13:29:52: Exception in set up method: The CurrentThread needs to have it's ApartmentState set to Apar

Console Application to launch Specflow features by code not using ncode runner

眉间皱痕 提交于 2019-12-11 06:19:19
问题 I have programmed an console application with c# for ranorex automation. Within the exe i have build i would like to kick off the specflow feature files manually. I believe I need to create a TestRunnerManager and trigger the run. Can anyone help? 回答1: Although not familiar with nunit, I guess like with mstest, attributes are used to mark methods in an assembly as tests. You could use reflection to find these methods in the assembly and invoke them 回答2: This question is similar in spirit to

How to set up a URL variable to be used in NUnit/SpecFlow framework

本秂侑毒 提交于 2019-12-11 06:12:17
问题 I'd like to extend the Test Harness I have written in SpecFlow to be a bit more extensible, so what I would like to do is in the setup create a base URL variable that I can set depending on a flag I use on the Nunit runner. So if I send in Test as a Tag I want some URL value to be set to "http://test/" or for Development to set URL to "http://dev/". I know Global variables are not useful in NUnit, most of my previous scripting was in Perl where even then I used it on rare occasions. I'm not

TDD: Number of Asserts, and what to actually assert? [closed]

旧城冷巷雨未停 提交于 2019-12-11 06:09:36
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I am currently writing tests using TDD and I have come up against a few queries. Normally when writing unit tests, i always used to use 1 assert per unit tests as this is what is defined as good practice and its easy to see why your test is failing. In TDD, is it also good

Windows 8 App in Visual Studio 2012 - NUnit Test Adapter sees unit tests but does not run them

可紊 提交于 2019-12-11 06:01:18
问题 I have a Windows 8 Store App with two projects within the solution - one project exclusively for tests. I have added NUnit and NUnit Test Adapter (https://www.nuget.org/packages/NUnitTestAdapter/1.0.0) for this through nuget. My tests are detected - but I cannot run or debug them. Looking at the test output window, I get the following error: Could not find test executor with URI 'executor://nunittestexecutor/'. Make sure that the test executor is installed and supports .net runtime version 4