xunit.net

xUnit test deadlock

爱⌒轻易说出口 提交于 2019-12-11 09:58:47
问题 When I run my xUnit unit tests I sometimes get an error message like "Transaction (Process ID 58) was deadlocked on lock resources with another process and has been chosen as the deadlock victim" on one or more of the tests, seemingly randomly. If I re-run any failing test on its own it passes. What should I do to prevent this? Is there an option to run the tests one-after-another instead of all at once? (N.B. I'm running the tests over the API methods in my ASP.Net 5 MVC controllers under

VSTS Configuration to run xUnit tests for x64 platform

蓝咒 提交于 2019-12-11 06:59:40
问题 I need to make configuration for run xUnit test that build only for x64 platform. How can I do that? I found this article but it doesn't help. I've got No test runs are available for this build. Here are my properties in VSTS: Test assemblies: **\*test*.dll !**\obj\** Search folder: src/Modules Test platform version: Visual Studio 2017 Build platform: x64 Build configuration: Release 回答1: Refer to these steps: Change BuildPlatform variable to x64 NuGet restore Build solution (Platform: $

How to run F# Silverlight Library project holding xUnit.net Contrib based unit tests?

非 Y 不嫁゛ 提交于 2019-12-11 02:13:37
问题 I am unaware of any project templates for F# Silverlight 4 unit tests (I searched Online for templates through Add Project), so I am using the standard F# Silverlight Library project to hold my unit tests (which are just file links to the main unit test project files). I am using xUnit.net Contrib for Silverlight. So everything compiles but I don't know how to run the tests! TestDriven.NET works for my normal unit test project but not this Silverlight unit test project. I tried to use the

Output from xUnit tests run with Visual Studio test runner not shown in Output window

℡╲_俬逩灬. 提交于 2019-12-11 01:32:55
问题 I created a fresh .NET Core Class Library project named FooBarBaz . I've then used the package manager console to run: Install-Package xunit xunit Install-Package xunit xunit.runners.visualstudio This is the only code I have added: using Xunit; using Xunit.Abstractions; namespace FooBarBaz { public class Class1 { private readonly ITestOutputHelper output; public Class1(ITestOutputHelper output) { this.output = output; output.WriteLine("OUTPUT FROM MY CONSTRUCTOR"); } [Fact] public void

Running F# xUnit Fact from TestDriven.NET reporting “It looks like you're trying to execute an xUnit.net unit test.”

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 01:29:44
问题 I am trying to run xUnit tests (from an F# module, if it makes any difference) using TestDriven.NET, but whatever I do I get this error: It looks like you're trying to execute an xUnit.net unit test. For xUnit 1.5 or above (recommended): Please ensure that the directory containing your 'xunit.dll' reference also contains xUnit's test runner files ('xunit.dll.tdnet', 'xunit.runner.tdnet.dll' etc.) For earlier versions: You need to install support for TestDriven.Net using xUnit's 'xunit

Visual Studio Test Explorer Error Logs

自古美人都是妖i 提交于 2019-12-11 01:09:24
问题 I've been attempting to fix a problem I have with Test Explorer not showing tests when I'm in a different configuration environment. I make local environment changes by updating my app.config. I have already tried a few steps found here and in other sites including cleaning my project, updating to the latest xUnit test runner, etc. I am sure the reason is code/project based and not the Visual Studio environment itself. What I would like to know is whether or not there is a log file I can look

.Net Core DynamodDB unit testing with XUnit

≯℡__Kan透↙ 提交于 2019-12-11 00:46:31
问题 Using C#, .net core 2.0, dynamo db I have my web api, that interact with my dynamo db database having both Get and Post methods. Example of Mehthod: [HttpGet("api/data")] public async Task<List<string>> GetAllData(string userId, string type, string status) { var creds = new BasicAWSCredentials(awsId, awsPassword); var dynamoClient = new AmazonDynamoDBClient(creds, dynamoRegion); var context = new DynamoDBContext(dynamoClient); List<ScanCondition> conditions = new List<ScanCondition>();

MSBuild task for combining NUnit or MSTest XML results

夙愿已清 提交于 2019-12-10 22:18:30
问题 I have a set of NUnit XML result files (produced by xUnit.NET via the NUnitXml parameter to the Xunit.Runner.MSBuild.xunit msbuild task pretty much as in How do I get Team Build to show test results and coverage for xUnit.net test suite? and http://jonnekats.wordpress.com/2009/05/07/integrate-xunit-tests-into-your-daily-team-build/) The script publishes each of the test runs individually, which is slow as it pulls in all the TestResults artifacts each time. Thus I'd like to combine them into

How (strategy) to unit test properties (get/set) in BDD style?

孤街浪徒 提交于 2019-12-10 17:52:38
问题 I have a class (of many) that have properties. Some have logic in them and some don't. Assuming I want to test these properties, how do I go about doing that? Recently, I've been interested in BDD style for creating unit tests. see here and here. So I'd do a setup of the context - basically create the SUT and load up whatever is needed. Then in each Observation (test method), I'd verify that a particular property contains what it should contain. Here's my question. If the SUT has 20

C# xUnit Test listeners

给你一囗甜甜゛ 提交于 2019-12-10 17:40:53
问题 I'm building a selenium test framework based on .Net Core and the team decided to go with xUnit. All's well and good everything has been going ok but for a while now, we've been trying to replicate the functionality of Java TestNG listeners without much luck. I've been digging around the xunit git repo and found a few instances where some interfaces such ITestListener have been used. After digging deeper, I found that these listeners are from a package called TestDriven.Framework and I wanted