Search Results

Search found 458 results on 19 pages for 'nunit'.

Page 3/19 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Run NUnit 2.5.5 tests in Gallio 3.1

    - by Daz Lewis
    Hi, I'm trying to get Gallio running some existing NUnit tests but they're not showing in Gallio. The assembly loads into Gallio fine and I can run them fine via Resharper within the VS IDE. I created a really simple NUnit test in VS and this also doesn't show so I know it's not something weird in my existing tests. Any ideas?

    Read the article

  • [NUnit+Moq] Guidelines for using Assert versus Verify

    - by emddudley
    I'm new to unit testing, and I'm learning how to use NUnit and Moq. NUnit provides Assert syntax for testing conditions in my unit tests, while Moq provides some Verify functions. To some extent these seem to provide the same functionality. How do I know when it's more appropriate to use Assert or Verify? Maybe Assert is better for confirming state, and Verify is better for confirming behavior (Classical versus Mockist)?

    Read the article

  • App.config for SpecFlow not recognized by NUnit GUI runner

    - by INTPnerd
    How do I get my App.config file to be recognized/used by the NUnit GUI runner? I have tried placing it in the top folder of my project and in the same folder as my feature files. Here are the contents of my App.config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow"/> </configSections> <specFlow> <runtime detectAmbiguousMatches="true" stopAtFirstError="false" missingOrPendingStepsOutcome="Error" /> </specFlow> </configuration> Specifically I am trying to tell NUnit to have a fail result when there is a missing or pending step which is why I am specifying "Error" for this. This actually works correctly when I use TestDriven.net but not when I use the NUnit GUI runner. The GUI always shows a green bar and displays the test as Inconclusive instead of Error or Failed

    Read the article

  • Configuring TeamCity + NUnit unit tests so files can be loaded properly

    - by Dave
    In a nutshell, I have a solution that builds fine in the IDE, and the unit tests all run fine with the NUnit GUI (via the NUnitit VS2008 plugin). However, when I execute my TeamCity build runner, all unit tests that require file access (e.g. for running tests against specific XML files), I just get System.IO.DirectoryNotFoundExceptions. The reason for this is clear: it's looking for those supporting XML files loaded by various unit tests in the wrong folder. The way my unit tests are structured looks like this: +-- project folder +-- unit tests folder +-- test.xml +-- test.cs +-- project file.xaml +-- project file.xaml.cs All of my projects own their own UnitTests folder, which contains the .cs file and any XML files, XML Schemas, etc that are necessary to run the tests. So when I write my test.cs, I have it look for "test.xml" in the code because they are in the same folder (actually, I do something like ....\unit tests\test.xml, but that's kind of silly). As I said before, the tests run great in NUnit. But that's because the unit tests are part of the project. When running the unit tests from TeamCity, I am executing them against the assemblies that get copied to the main app's output folder. These unit test XML files should not be copied willy-nilly to the output folder just to make the tests pass. Can anyone suggest a better method of organizing my unit tests in each project (which are dependencies for the main app), such that I can execute the unit tests from NUnit and from the TeamCity build runner? The only other option I can come up with is to just put the testing XML data in code, rather than loading it from a file. I would rather not do this.

    Read the article

  • NUnit, CollectionAssert.AreEquivalent(...,...), C# Question

    - by K-Bell
    I new to NUnit and looking for an explination as to why this test fails? I get the following exception when running the test. NUnit.Framework.AssertionException: Expected: equivalent to < <....ExampleClass, <....ExampleClass But was: < <....ExampleClass, <....ExampleClass using NUnit.Framework; using System.Collections.ObjectModel; public class ExampleClass { public ExampleClass() { Price = 0m; } public string Description { get; set; } public string SKU { get; set; } public decimal Price { get; set; } public int Qty { get; set; } } [TestFixture] public class ExampleClassTests { [Test] public void ExampleTest() { var collection1 = new Collection<ExampleClass> { new ExampleClass {Qty = 1, SKU = "971114FT031M"}, new ExampleClass {Qty = 1, SKU = "971114FT249LV"} }; var collection2 = new Collection<ExampleClass> { new ExampleClass {Qty = 1, SKU = "971114FT031M"}, new ExampleClass {Qty = 1, SKU = "971114FT249LV"} }; CollectionAssert.AreEquivalent(collection1, collection2); } }

    Read the article

  • How to run assembly using NUnit's TestSuiteBuilder

    - by Dror Helper
    I'm trying to write a simple method that receives a file an runs it using NUnit. The code I managed to build using NUnit's source does not work: if(openFileDialog1.ShowDialog() != DialogResult.OK) { return; } var builder = new TestSuiteBuilder(); var testPackage = new TestPackage(openFileDialog1.FileName); var directoryName = Path.GetDirectoryName(openFileDialog1.FileName); testPackage.BasePath = directoryName; var suite = builder.Build(testPackage); TestResult result = suite.Run(new NullListener(), TestFilter.Empty); The problem is that I keep getting an exception thrown by builder.Build stating that the assembly was not found. What am I missing?

    Read the article

  • Why does NUnit ignore datapoints when using generics in a theory

    - by The Chairman
    I'm trying to make use of the TheoryAttribute, introduced in NUnit 2.5. Everything works fine as long as the arguments are of a defined type: [Datapoint] public double[,] Array2X2 = new double[,] { { 1, 0 }, { 0, 1 } }; [Theory] public void TestForArbitraryArray(double[,] array) { // ... } It does not work, when I use generics: [Datapoint] public double[,] Array2X2 = new double[,] { { 1, 0 }, { 0, 1 } }; [Theory] public void TestForArbitraryArray<T>(T[,] array) { // ... } NUnit gives a warning saying No arguments were provided. Why is that?

    Read the article

  • nunit with testdriven.net problem in .net 4

    - by Nima
    Greeting, currently we migrate our project to .net 4. also we use .nunit 2.5.5 with testdriven.net 3. I got this error, when I run tests. Test 'TestCase1' failed: System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. at NetSpec.TestingExtensions.ShouldEqual(Object o, Object expected) at NetSpec.TestingExtensions.ShouldBe(Object o, Object expected) Personnel\CivilServant\SubCategorySpec.cs(37,0): at Azarakhsh.Domain.Test.Personnel.CivilServant.when_validate_a_subCategoey.should_have_code() 0 passed, 1 failed, 0 skipped, took 9.35 seconds (NUnit 2.5.5).

    Read the article

  • Good tools which generate NUnit unit tests for .NET assemblies in Visual Studio 2008

    - by andy
    Hey guys, I'm pretty new to Unit Testing so bare with me. I realize that best best practice is not to auto generate unit tests, however I'd like to use Code Generation to set-up the basic skeleton of the tests. Now, I know Visual Studio 2008 already has the built in "create tests", however, it just creates a flat list of all the classes it's going to test... and it's not for NUnit right? Ideally, I'd like the code generation to follow the folder AND namespace structure of the assembly its generating tests for. Can you guys recommend any good tools which generate NUnit unit tests for .NET assemblies in Visual Studio 2008? cheers!

    Read the article

  • BackgroundWorker not working with TeamCity NUnit runner

    - by Catalin DICU
    I'm using NUnit to test View Models in a WPF 3.5 application and I'm using the BackgroundWorker class to execute asynchronous commands.The unit test are running fine with the NUnit runner or ReSharper runner but fail on TeamCity 5.1 server. How is it implemented : I'm using a ViewModel property named IsBusy and set it to false on BackgroundWorker.RunWorkerCompleted event. In my test I'm using this method to wait for the BackgroundWorker to finish : protected void WaitForBackgroundOperation(ViewModel viewModel) { int count = 0; while (viewModel.IsBusy) { RunBackgroundWorker(); if (count++ >= 100) { throw new Exception("Background operation too long"); } Thread.Sleep(100); } } private static void RunBackgroundWorker() { Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Background, new ThreadStart(delegate { })); System.Windows.Forms.Application.DoEvents(); } Well, sometimes it works and sometimes it hangs the build. I suppose it's the Application.DoEvents() but I don't know why...

    Read the article

  • Books or Articles on Using NUnit to Test Entire Features

    - by INTPnerd
    Are there any books or articles that show you how to use NUnit to test entire features of a program? Is there a name for this type of testing? This is different from the typical use of NUnit for unit testing where you test individual classes. This is similar to acceptance testing except that it is written by the developer to discern that the program does what they interpreted as being what the customer wants the program to do. I don't need it to be readable by non-programmers or to produce a readable specification for non-programmers. The problem I am having is keeping this feature testing code maintainable. I need help in organizing my feature testing code. I also need help organizing the program code to be drivable in this way. I am having a hard time being able to issue commands to the program while still having good code design.

    Read the article

  • Running NUnit Tests from Code

    - by Dror Helper
    I'm trying to write a simple method that receives a file an runs it using NUnit. The code I managed to build using NUnit's source does not work: if(openFileDialog1.ShowDialog() != DialogResult.OK) { return; } var builder = new TestSuiteBuilder(); var testPackage = new TestPackage(openFileDialog1.FileName); var directoryName = Path.GetDirectoryName(openFileDialog1.FileName); testPackage.BasePath = directoryName; var suite = builder.Build(testPackage); TestResult result = suite.Run(new NullListener(), TestFilter.Empty); The problem is that I keep getting an exception thrown by builder.Build stating that the assembly was not found. What am I missing?

    Read the article

  • How to Run NUnit Tests from C# Code

    - by Dror Helper
    I'm trying to write a simple method that receives a file and runs it using NUnit. The code I managed to build using NUnit's source does not work: if(openFileDialog1.ShowDialog() != DialogResult.OK) { return; } var builder = new TestSuiteBuilder(); var testPackage = new TestPackage(openFileDialog1.FileName); var directoryName = Path.GetDirectoryName(openFileDialog1.FileName); testPackage.BasePath = directoryName; var suite = builder.Build(testPackage); TestResult result = suite.Run(new NullListener(), TestFilter.Empty); The problem is that I keep getting an exception thrown by builder.Build stating that the assembly was not found. What am I missing? Is there some other way to run the test from the code (without using Process.Start)?

    Read the article

  • environment configuration for tests running in NUnit

    - by Frank Schwieterman
    I have some integration tests that hit a webserver and verify certain functionalities. Depending on the build environment, the server will be at a different address (http://localhost:8080/, http://test-vm/, etc). I would like to run these tests from a TFS build. I'm wondering whats the appropriate way to configure these tests? Would I just add a setting to the config file? I'm doing that currently. Incidentally we do have a separate branch per test environment, so I could have a different config file checked in for each environment. I wonder if there is a better way though? I'd like the build project to be able to tell the test what server to test. This seems better because then I don't have to maintain config information on a per branch basis. I believe I'd be using NUnit for Team Build (http://nunit4teambuild.codeplex.com/) to get NUnit/TFS to play together.

    Read the article

  • nUnit error when loading dll what to do ?

    - by Night Walker
    Hello all I am trying to run my first nunit example , but i am getting some error when i am loading the dll file with the tests by nunit . the example taken from here link text --------------------------- Assembly Not Loaded --------------------------- System.ApplicationException : Invalid cache path: C:\Documents and Settings\pauly\Local Settings\Temp;C:\Windows\Microsoft.NET\Framework\V2.0.50727\nunit20\ShadowCopyCache\4344_634116012858505240 ----> System.NotSupportedException : The given path's format is not supported. For further information, use the Exception Details menu item. --------------------------- OK --------------------------- Any idea what is wrong here ? Thanks .

    Read the article

  • NUnit with an ASP.net web site

    - by Ed Woodcock
    Hi folks, I'm currently trying to upgrade our build server at work, going from having no build server to having one! I'm using JetBrains TeamCity (having used ReSharper for a couple of years I trust their stuff), and intend to use NUnit and MSBuild. However, I've come up with an issue: it appears that it is not possible to test an ASP.net Web Site with NUnit. I had assumed it would be possible to configure it to test App_Code after build, however it seems that the only way to do tests nicely is through converting the Web Site to a Web Application (which my boss does not like the idea of). Does anyone have a suggestion as to how I could go about this? Please bear in mind that the testing needs to be able to be fired automatically from TeamCity.

    Read the article

  • Executing NUnit Tests using the Visual Studio 2012 Test Runner

    - by David Paquette
    At a recent Visual Studio 2012 event at the Calgary .NET User Group, I was told that I could run my NUnit tests directly in the Visual Studio 2012 without any special plugins.  Naturally, I was very excited and I immediately tried running my NUnit tests. I was somewhat disappointed to see that the Test Runner did not discover any of my NUnit tests.  Apparently, you do still need to install an extension that supports NUnit.  Microsoft has completely re-written the Test Runner in Visual Studio 2012 and opened it up for anyone to write Test Adapters for any unit test framework (not just MSTest).  Once the correct test adapters are installed, everything works great.  Luckily, there are a good number of adapters already written. Here are some Test Adapters that you might find useful: NUnit Test Adapter – This one is still in beta, but tit does work with the official Visual Studio 2012 release xUnit.net Test Adapter Silverlight Unit Test Adapter Chutzpah Test Adapter Overall, I still prefer the unit test runner in ReSharper, but this is a great new feature for those who might not have a ReSharper license.

    Read the article

  • How to copy/install assembly in a GAC? (Some problem running NUnit)

    - by prosseek
    I have NUnit installed at this directory. C:\Program Files\NUnit 2.5.5\bin\net-2.0 I made the directory beneath a GAC. C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NUnit and copied the nunit.framework.dll, but I got the same error. When I try to run my unit test (mut.dll) in some random directory. I get the following error. I have to copy the mut.dll under the NUnit directory in order to run it. ProcessModel: Default DomainUsage: Single Execution Runtime: net-2.0 Could not load file or assembly 'nunit.framework, Version=2.5.5.10112, Culture=n eutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system cannot find the file specified. What went wrong? How can I install/copy the assembly inside a GAC?

    Read the article

  • nunit-console can not loacte fixture

    - by tguclu
    Hi I have 2.5.8 and VS2010 I want to run tests against a dll and if I type >nunit-console a.dll I also have these suites namespace LicMgmtLib.Tests { /// <summary> /// Contains the complete suite for LicMgmtLibTest project /// </summary> public class AllTests { [Suite] public static IEnumerable Suite { get { List<Type> suite = new List<Type>(); foreach (Type testCase in UnitTests.Suite) { suite.Add(testCase); } return suite; } } } } and namespace LicMgmtLib.Tests { /// <summary> /// Contains the unit test cases for LicMgmtLibTest project /// </summary> public class UnitTests { [Suite] public static IEnumerable Suite { get { List<Type> suite = new List<Type>(); suite.Add(typeof(LicenceManagerTests)); suite.Add(typeof(CertManagerTests)); return suite; } } } } If I would like to run tests using Suites I type nunit-console a.dll /fixture=AllTests.Suite but it fails with the message >Unable to locate fixture AllTests.Suite If you wonder why I use Suites ,I don't know. We are using MSBuild in our project and this is a requirement of MSBuild I guess. Any help appreciated Regards

    Read the article

  • Problem with SQLite related nUnit-tests after upgrade to VS2010 and Re#5

    - by stiank81
    After converting to Visual Studio 2010 with ReSharper5 some of my unit tests started failing. More specifically this applies to all unit tests that use NHibernate with SQLite. The problem seem to be related to SQLite somehow. The unit tests that does not involve NHibernate and SQLite are still running fine. The exception is as follows: NHibernate.HibernateException : Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4. ----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. ----> NHibernate.HibernateException : The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found. Ensure that the assembly System.Data.SQLite is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly. TearDown : System.NullReferenceException : Object reference not set to an instance of an object. The exception is the NullReferenceException on TearDown when cleaning up NHibernate objects that wasn't successfully created, but the problem seem to be related to SQLite somehow. I run my unit tests through ReSharper, but I get the same exception when running them directly through the NUnit.exe application. However, running them through the x86 variant (NUnit-x86.exe) all tests run fine. Can it be related to some mixing of 64bit and 32bit dlls? It still runs fine through VS2008 + ReSharper4.5. Note that the target framework of my projects still is .NET3.5. Anyone seen this problem before?

    Read the article

  • Creating parallel selenium tests in C# and using Nunit as the runner application

    - by damianmartin
    I am writing a new test suite for the company to test a very complex ASP.NET application which is heavily AJAX driven. We have decided to use Selenium (Grid & Remote Control) and Nunit to run these tests. The actually tests are dynamically created at run time from a spreadsheet. Each Column in an excel spreadsheet relates to a new test and each row relates to a selenium command (but in plain English and the dll converts this into Selenium code). My problem i have at the moment is getting the tests running in parallel. There will be 1000+ tests so it is too time consuming to have 1 test run at a time. Selenium Grid and Selenium Remote Control(s) are setup correctly because I can run there demo. From what i have read I need to use Punit but i can not find any documentation on what a test in punit should look like. Nunit tests are [SetUp] [TearDown] [Test]. Can anyone point me in the right direction. Thanks in advance.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >