nunit

What else is needed to get the Hosted Build Controller to run my NUnit tests

耗尽温柔 提交于 2019-12-11 03:04:09
问题 I am unable to get Visual Studio Online's Hosted Build Controller to run my NUnit tests despite following the instructions given in "Add assemblies for custom activities and other unit test frameworks" to add the required NUnit binaries and making the build controller aware of them. I tried all this first in a Git project and couldn't get it to work, despite the information in Visual Studio Online CI Nunit Tests not found during build. My current efforts are in a TFVC project, so the fact

How do I configure my settings file to work with unit tests?

拟墨画扇 提交于 2019-12-11 02:59:36
问题 I have a library I'm writing unit tests for. The library is used by two applications: one a Windows service, the other a command-line application that does some registry read-writes. Each has a slightly different App.config file that is loaded from the library at start-up. For example: public RetentionService() { SettingHive = new Hive(); TimingService = new RetentionTimingService(SettingHive); AppSettingsReader asr = new AppSettingsReader(); object appsListObj = asr.GetValue(@"blocking

Rhino Mocks: AAA Synax: Assert property was set with a given type

╄→гoц情女王★ 提交于 2019-12-11 02:43:29
问题 I am trying to assert that a property in a mock object was set with a given type. The property has an abstract type and is set with one of a number of concrete types. This is what I'm trying to do, and it's always passing the test regardless of the value that Foo.DoSomething() sets Foo.Bar with: [Test] public void DoSomething_SetsCorrectBar() { // Arrange Foo foo = MockRepository.GenerateMock<Foo>(); // Creates mock in Replay mode (what I want for AAA syntax). // Act foo.DoSomething(); //

Problems with NUnit under Mono

走远了吗. 提交于 2019-12-11 02:27:56
问题 my problem is that I have a project developed in visual Studio .NET 4.0 and it must have compatibility with Mono. MoMa tool says that there's no problem. When I try to run the tests with NUnit Mono 2.0 Profile says to me the next exception: System.MissingMethodException... at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg, System.Exception& exc, System.Object[]& out_args) [0x00000] in <filename unknown>:0 I have Mono 2.10

Resharper Test Runner: Could not load file or assembly 'System.Windows'

寵の児 提交于 2019-12-11 02:06:51
问题 I have an issue with VS2012 and Resharper 7.1.2 at the moment to run unit tests (Nunit). The complete error message is here: Unit Test Runner failed to run tests: System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows, Version=5.0.5.0, Culture =neutral, PublicKeyToken= 7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified." I have upload the last version of Resharper (7.1.2) and i tried use vs2010 but the problem is there yet. Any

Unit Test of WPF Application fails with NotSupportedException “The Uri prefix is not recognized”

↘锁芯ラ 提交于 2019-12-11 02:06:32
问题 I'm currently writing unit tests and at this position the tests fails with a NotSupportedException "The URI prefix is not recognized" After small research I have registered the "pack" Uri scheme, but it dosn't helps. return _WaitImageThumbnail ?? (_WaitImageThumbnail = new BitmapImage(new Uri("pack://application:,,,/MyAssemblyName;component/images/DefaultThumbnailLoading.png"))); Stacktrace: at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) at System.Net.WebRequest.Create

How can I suppress nunit console output?

丶灬走出姿态 提交于 2019-12-11 01:34:58
问题 Is there a way to suppress nunit errors and failures displayed on console output? I tried using the command line options: /xml, /out, /err. But still get the output in console. 回答1: From your use of the /xml option, I can see you are using an older version of NUnit, however, the answer is the same for newer ones as well. There is no way to change the report output produced by the console runner. You can redirect the entire thing to a file, or even to the null device, but you can't suppress

WatiN generates empty pages

Deadly 提交于 2019-12-11 01:26:03
问题 When capturing images using WatiN the resulting images are just empty, solid black. The size of the images equals the screen size, though. For example the following snippet just saves two black images. using (IE ie = new IE()) { ie.ClearCache(); ie.BringToFront(); ie.GoTo("http://localhost/"); ie.CaptureWebPageToFile(imageDir + "\\localhost.png"); WatiN.Core.CaptureWebPage capture = new CaptureWebPage(ie); capture.CaptureWebPageToFile(imageDir + "\\localhost.jpg", true, true, 100, 80); Assert

How to pass a Type as an attribute parameter using F# syntax?

血红的双手。 提交于 2019-12-11 00:54:59
问题 FsCheck allows a custom Arbitrary in its NUnit integration: [<Property(Verbose = true, Arbitrary= [typeof<Test.Arithmetic.MyArb>])>] static member MultiplyIdentity (x: int64) = x * 1 = x This syntax doesn't work. I feel a bit embarrassed to ask, but apparently I never needed this before: how do you specify the type in F# as an attribute parameter? Microsoft says nothing about it, nor does the Wikibooks project and I have some trouble googling this (the word type is omnipresent). Note 1: the

Run all tests in namespace using Nunit3-console.exe

妖精的绣舞 提交于 2019-12-11 00:34:09
问题 After pouring over the NUnit 3 documentation on Test Selection Language and trying a few combinations, I still cannot figure out how to run all the tests within a specific namespace. The most obvious attempt being: nunit3-console.exe --where "test == 'MyNamespace.Subnamespace'" Tests.dll Unfortunately, this reports zero matching tests, although using the --explore options I can see many tests within that namespace. Do I need to use regular expression/wildcards to accomplish this? The NUnit