nunit

Nunit-console.exe fails with return code 7 using Nant and Bamboo

空扰寡人 提交于 2019-12-11 11:23:08
问题 I'm getting not too much saing error while running nunit test on Bamboo build server. It causes showing build resuts as red and shows that project has only 27 unit test and all they passing (project has more than 500 tests and some are failing) I've tried to run the same test using nunit-console on my local machine, but it runs without any problems. Bamboo log: [exec] D:\BambooAgent\..\nant.build(277,5): [exec] External Program Failed: C:\Program Files\NUnit 2.5.9\bin\net-2.0\nunit-console

Nunit and web applications

落花浮王杯 提交于 2019-12-11 11:16:49
问题 I begin studying Unit testing with "(NUnit)". I know that this type of testing is used to test "classes" , "functions" and the "interaction between those functions". In my case I develop "asp.net web applications". How can i use this testing to test my pages(as it is considered as a class and the methods used in)and in which sequence?, i have three layers: Interface layer (the .cs of each page). Data access layer (class for each entity)(DAL). Database layer (which contains connection to the

Nunit DLL issue - Namespace can't be found?

我们两清 提交于 2019-12-11 10:56:21
问题 I installed NUnit via NuGet. NUnit shows up in my project references, and there doesn't appear to be a problem. I created a test class, just to make sure it loaded correctly: using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; namespace MyNamespace { [TestFixture] public class UnitTests { [Test] public void TestMethod() { } } } However, when building, I get: "The type or namespace name 'NUnit' could not be found (are you missing a using

Process timeout without showing any error in test execution using cc.net

ε祈祈猫儿з 提交于 2019-12-11 10:47:28
问题 nunit tests fails when run through cc.net saying process timeout. Process has been killed All works fine when through nUNit or VS. Also cc.net will then show the results of previous build even if the build is a clean one. Any help plz. 回答1: The default timeout is 600 seconds. If your tests start to exceed that the build will fail with no indication. You may need to up the timeouts for your cc.net nunit task 回答2: If you are seeing the results from a previous build, it is probably because you

UnitTesting in VS2010: How to ship unit tests and test runner in the executable?

倖福魔咒の 提交于 2019-12-11 10:36:40
问题 i want to ship unit test code, and the test runner, in the final executable that is given to the customer. i want to do this so that tests can be run at, by, for or with the customer. The problem is that Visual Studio's test system seems to be contained in the assembly: c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll and this assembly doesn't ship with the .NET framework (full or client profile). This

teststack white get the main window after the login window

左心房为你撑大大i 提交于 2019-12-11 10:34:15
问题 I am working on automating a windows application using Teststack white, the current issues that I have is that after logging in the main application, white doesn't seems to find the new window. var pathAp = appPath(path); Application application = Application.Launch(pathAp); Window window = application.GetWindow("login"); TextBox userName = window.Get<TextBox>("userName"); TextBox pass = window.Get<TextBox>("pass"); userName.Enter("user1"); pass.Enter("pass"); Button login = window.Get<Button

What is the accepted practice for adding Nunit tests to an existing solution?

只愿长相守 提交于 2019-12-11 09:59:03
问题 I have inherited a reasonable sized ASP.net solution that has no automated tests. The solution seems to include all of the source/pages in one solution with no name-spacing and no separation of tiers, so there are direct SQL calls within code behind files etc. Before making changes to this site I would like to add some unit tests, preferably using nunit as I am familiar with the Xunit model, to give me some confidence that I have not broken anything. I do not have much .net experience, and

I need to create a windows form from within a NUnit test

给你一囗甜甜゛ 提交于 2019-12-11 09:27:44
问题 I need to make a NUnit test class that tests my screen scraper. 1) I would like to have a [SetUp] method that will create a dummy window, simple windows form with just a predefined title and a background image. Setup method then should wait for a full initialization of the dummy window, i.e. wait for the dummy form to load and display background image and keep it open. 2) I will run the actual tests. 3) TearDown method will close the dummy window. The 2) and 3) is not a problem (I think), but

How to perform NUnit testing in a project on class level?

こ雲淡風輕ζ 提交于 2019-12-11 08:57:15
问题 I want to perform an NUnit Testing on a method of my project. Here SerializeBinary() method is converting object into binary streams and DeserializeFromBinaryStream() method once again convert it into previous same object format.now I want to check wheather these both objects are same or not after DesirializingFromBinary() method task. I go through from Here:, but did not clear my concepts. I am attaching my part of code below. First part: public abstract class Streaming { private static int

How to perform Nunit testing for a class inherting from a base class with parameterised constructor

我只是一个虾纸丫 提交于 2019-12-11 08:12:35
问题 namespace TestBI { [TestFixture] class ClassChild:ClassParent { public ClassChild(DataRow row, string name): base(row, detail) { } [Test] public void Test() { DataRow dr = new DataRow(); dr[0] = 1; dr[1] = "ram" ClassChild ch = new ClassChild(dr,"student"); : : : Assert.AreEqual(string1,string2); } } } When I run the test,i get an error as "TestBI.ChildClass.Test suitable constructor was found" How do i need to pass parameters here to child class? 回答1: Provide a zero argument constructor for