mbunit

MbUnit: The most elegant way to compare doubles?

≯℡__Kan透↙ 提交于 2019-12-10 07:06:02
问题 The code Assert.AreEqual (9.97320998018748d, observerPosition.CenterLongitude); produces Expected Value & Actual Value : 9.97320998018748 Remark : Both values look the same when formatted but they are distinct instances. What is the most elegant way to compare two doubles for equality in MbUnit 3.0? I know I could round them up myself, but is there some MbUnit construct for this? UPDATE: I consider my current "workaround" to be non-elegant: Assert.LessThan( Math.Abs(9.97320998018748d -

TestDriven.NET is not running my SetUp methods for MbUnit

♀尐吖头ヾ 提交于 2019-12-08 14:36:16
问题 I've created some MbUnit Test Fixtures that have SetUp methods marked with the SetUp attribute. These methods run before the tests just fine using the MbUnit GUI, the console runner, and the ReSharper MbUnit plugin. However, when I run the tests with TestDriven.NET it does not run the SetUp methods at all. Does anyone know if this is a bug with TestDriven.NET or if I have something setup wrong? 回答1: No longer an issue with recent versions of Gallio since v3.0.4. Just make sure to use the 64

MSTest and NHibernate

时光毁灭记忆、已成空白 提交于 2019-12-07 01:33:56
问题 Does anyone have any experience getting MSTest to copy hibernate.cfg.xml properly to the output directory? All my MSTests fail with a cannot find hibernate.cfg.xml error (I have it set to Copy Always), but my MBUnit tests pass. 回答1: You can try adding the DeploymentItemAttribute to one of your tests, or edit your .testrunconfig file and add the file to the Deployment list. 回答2: Edit localtestrun.testrunconfig (in your solution items folder). Select the deployment option and add the hibernate

How do I get Team Build to run MbUnit tests?

社会主义新天地 提交于 2019-12-06 15:25:18
问题 I am having trouble getting Team Build to execute my MbUnit unit tests. I have tried to edit TFSBuild.proj and added the following parts: <Project ...> <UsingTask TaskName="MbUnit.MSBuild.Tasks.MbUnit" AssemblyFile="path_to_MbUnit.MSBuild.Tasks.dll" /> ... ... <ItemGroup> <TestAssemblies Include="$(OutDir)\Project1.dll" /> <TestAssemblies Include="$(OutDir)\Project2.dll" /> </ItemGroup> <Target Name="Tests"> <MbUnit Assemblies="@(TestAssemblies)" ReportTypes="html" ReportFileNameFormat=

C# Unit Testing: Integrate NUNIT/MBUNIT with MIcrosoft PEX

爷,独闯天下 提交于 2019-12-06 13:56:56
问题 C# Unit Testing: How to integrate NUNIT/MBUNIT with Microsoft PEX(Parameterized unit testing). After I have seen few videos of Microsoft PEX, wondering whether I can able to add PEX testing in my NUNIT test project and also want to add them to nightly build. Is that possible? 回答1: Yes, it is possible. We run a pretty ordinary (non-bleeding edge government style) setup with CruiseControl.Net running NAnt running MSBuild, NUnit, Code Contracts, Pex. Tests are generated with the Pex Visual

My ReSharper Gutter Icons for Unit Tests aren't showing

♀尐吖头ヾ 提交于 2019-12-06 01:51:20
问题 I've installed ReSharper 4.1 and Gallio 3.0.5, but I don't get the gutter icons for unit tests. The tests seem to run fine in the Test Explorer, but I don't have icons next to the tests in code. What could be causing this? I previously had the MbUnit 2.4 ReSharper plugin installed, but it should be uninstalled now. 回答1: I did this to get them to show up again. Maybe it was an overkill. Uninstall ReSharper Uninstall Gallio Delete %appdata%\JetBrains folder Install ReSharper Start Visual Studio

Gallio test runner plugin to Visual Studio 2008 and 2010 for MBUnit tests

偶尔善良 提交于 2019-12-05 20:54:25
问题 If I install Gallio 3.x will it also install a test runner plugin for Visual Studio? Or must I use an additional plug-in like TestDriven.NET or Visual Nunit to run MbUnit test classes from within VS? 回答1: TestDriven.Net works really well. Gallio also supports the ReSharper unit test runner and Visual Studio test tools. We will be shipping a new release of Gallio this week with support for R# 5.0 and VS 2010. 回答2: Install Gallio 3.1 on the dev machine. Then in VS2008, you'll have the option to

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

我与影子孤独终老i 提交于 2019-12-05 13:37:33
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 subject under test; I want to apply these techniques to the testcases themselves. It's pretty clear how

What is a Generative Unit Test Framework?

房东的猫 提交于 2019-12-05 12:52:11
问题 On stackoverflow I've come across mbunit. On its page it states that mbunit is a generative unit test framework, but I can't find anywhere that describes what a Generative unit test framework is. I was hoping to get : A definition Links to articles about what a Generative Unit Test framework is and isn't. 回答1: A generative testing framework is one where the code itself generates test cases . Typically you write code to generate test cases according to one or more assumptions you would like to

C# Unit Testing: Integrate NUNIT/MBUNIT with MIcrosoft PEX

梦想与她 提交于 2019-12-04 21:58:03
C# Unit Testing: How to integrate NUNIT/MBUNIT with Microsoft PEX(Parameterized unit testing). After I have seen few videos of Microsoft PEX, wondering whether I can able to add PEX testing in my NUNIT test project and also want to add them to nightly build. Is that possible? Yes, it is possible. We run a pretty ordinary (non-bleeding edge government style) setup with CruiseControl.Net running NAnt running MSBuild, NUnit , Code Contracts , Pex . Tests are generated with the Pex Visual Studio (Professional edition) GUI and then the generated files are checked in to our SVN. There is no extra