mbunit

Migration from MBUnit v2 to v3 and the ProviderFactory is gone

醉酒当歌 提交于 2020-01-07 02:25:27
问题 In MBUnit v2 I did this: public class ConnectionStringFactory { [Factory] public string ConnectionString { get { return ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString; } } } [ProviderFactory(typeof(ConnectionStringFactory),typeof(string))] public class CustomerTests { public void GetCustomerTest(string connectionString) { } public void GetCustomersTest(string connectionString) { } } I had to create ONE Factory class returning me a connectionString which gets injected

Register a Gallio zip installation with TestDriven.Net

一世执手 提交于 2019-12-25 00:23:09
问题 I want to register a copy of the Gallio zip installation with TestDriven.Net. In another thread, a member has mentioned that the Gallio installer needs to run after the TD installer in order to register Gallio with TD. Unfortunately, I can't run the lastest Gallio installer per corporate policy. Is there a way around this problem? Thanks. Update: Manually editing the registry worked for me. On Windows XP, under HKEY_CURRENT_USER/Software/MutantDesign/TestDriven.NET/TestRunners, Add key Gallio

How do I get Gallio.echo to run MbUnit Tests?

为君一笑 提交于 2019-12-24 09:17:35
问题 I have MbUnit tests that run if I load them into MbUnit.GUI.exe, however when I try to execute them from the Gallio.echo command-line tool I get 0 test available. I then loaded the assemblies into the Gallio GUI and the tests do not show. I am missing something with the Gallio set-up and the documentation is lacking to put it mildly. Can anyone point me in the right direction? Thank you - Bruce 回答1: Make sure your MbUnit v2 tests are compiled with the same version of MbUnit v2 as is

How to programmatically run unit tests with Gallio and MBUnit?

好久不见. 提交于 2019-12-23 09:00:16
问题 I'm trying to programmatically check my unit tests are passing as part of my deployment process. The application uses MBunit and Gallio for it's unit testing framework. Here's my code: var setup = new Gallio.Runtime.RuntimeSetup(); setup.AddPluginDirectory(@"C:\Program Files\Gallio\bin"); using (TextWriter tw = new StreamWriter(logFilename)) { var logger = new Gallio.Runtime.Logging.TextLogger(tw); RuntimeBootstrap.Initialize(setup, logger); TestLauncher launcher = new TestLauncher();

How to use AOP from DI Frameworks With C# TestFrameworks? (NOT for the item under test)

流过昼夜 提交于 2019-12-22 08:53:25
问题 My apologies in advance for a terrible title- suggestions welcome! I've been reading about DI and AOP, and I think I grasp the basics; at least for the canonical example of adding logging. I would like to apply this to the test cases we've been creating in NUnit e.g. be able to automatically add entry/exit logging for all test case methods and any 'helper methods' that they call. (And I'm not tied to NUnit- if it's easier in another framework, please let me know.) NOTE- this is not about the

UsingFactories alternative in MbUnit v3

荒凉一梦 提交于 2019-12-21 19:59:27
问题 I am trying to figure out how to write combinatorial test in MbUnit v3. All of the sample code on the web refers to MbUnit v2, which means using 3 attributes: CombinatorialTest Factory UsingFactories In MbUnit v3 there is no UsingFactories attribute (and the Factory attribute semantics is widely different and CombinatorialTest attribute is no longer needed). So how can I tell which factory method bind to which parameter in the particular unit test method? Thanks. 回答1: I have found out, with

Does Resharper 6.1 work with MBUnit?

眉间皱痕 提交于 2019-12-14 04:25:17
问题 Unfortunately Resharper has a long history of breaking MBUnit support with every new release. I noticed version 6.1 has been released, but I can't use it until it works properly with MBUnit. So, does Resharper still work with MBUnit? I'd try it myself, but last time I did I lost all of my Resharper settings while downgrading, so I thought I'd better ask first this time. Thanks, Adrian 回答1: There's no official Gallio release supporting ReSharper 6.1 just yet. However, 6.1 support is a work in

Debug Unit Tests using Resharper 7 for MBUnit throws an exception

最后都变了- 提交于 2019-12-11 16:33:27
问题 I have installed the Gallio Resharper Test Runner found at http://code.google.com/p/mb-unit/issues/detail?id=900#c9 Per the instructions at How to support MBUnit tests in Resharper 7. When I right click inside of a unit test and click "Run Unit Tests" the tests run just fine. However when I right click and then click "Debug Unit Tests" I get: Could not load file or assembly 'Gallio.ReSharperRunner71, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system

How do I ignore a test conditionally in mbUnit?

六眼飞鱼酱① 提交于 2019-12-10 23:25:03
问题 I'm using TeamCity to do automated builds of test and production. TeamCity runs our mbUnit 3.1 tests at the end of the process with Gallio. When running the test build, Gallio should try to execute tests against the test database server. However, when running a production build, these tests should not be run because TeamCity can't access the production database server (and if even if the production database was available, many tests would fail with unreleased code). How can I mark a test so

VS 2010 and MBUnit how to run just one test

大憨熊 提交于 2019-12-10 16:21:42
问题 I have Gallio/MbUnit installed and am using VS 2010 RC and I want to be able to run a single unit test or just all unit tests inside of a TestFixture and not all the tests in the entire project everytime I debug. How do you do this in VS 2010? 回答1: Install testdriven.net, there is a free personal version http://www.testdriven.net/ 回答2: As Simon said, TD.Net is just working well. If you work with VS2010 Premium or Ultimate, you may also use the built-in test run feature of VS2010. It should