# Import xUnit tests fails for "Skipped" tests

**URL:** https://www.finalbuilder.com/forums/t/import-xunit-tests-fails-for-skipped-tests/6712
**Category:** Bugs
**Tags:** continua-ci
**Created:** [January 31, 2020, 10:16am UTC](https://www.finalbuilder.com/forums/t/import-xunit-tests-fails-for-skipped-tests/6712 "2020-01-31T10:16:55Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tdestro](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/8baadc/32.png) [@tdestro](https://www.finalbuilder.com/forums/u/tdestro)
#### Post date: [January 31, 2020, 10:16am UTC](https://www.finalbuilder.com/forums/t/import-xunit-tests-fails-for-skipped-tests/6712/1 "2020-01-31T10:16:56Z")

</div>

Hello!  
I have written some unit tests that are still disabled (marked with the “Skipped” hint) and continua-ci seems not to be able to import the results with the “Import xUnit Tests”.  
Is this a bug? I found here the same topic for importing JUnit tests, but nothing for xUnit.

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [February 2, 2020, 11:22pm UTC](https://www.finalbuilder.com/forums/t/import-xunit-tests-fails-for-skipped-tests/6712/2 "2020-02-02T23:22:58Z")

</div>

Hi @tdestro,

This works for us. If we mark the tests as follows:

```auto
[Fact(Skip = "Reason for skipping")]

```

The tests are listed in the “Not Run” section with the result “Skip”.

How are you marking your skipped tests?

Can you send us your test results xml file via direct message (click on my profile icon and then hit the Message button) or via email to support at finalbuilder.com?

---

<div class="post-metadata">

### Author: ![tdestro](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/8baadc/32.png) [@tdestro](https://www.finalbuilder.com/forums/u/tdestro)
#### Post date: [February 3, 2020, 3:58pm UTC](https://www.finalbuilder.com/forums/t/import-xunit-tests-fails-for-skipped-tests/6712/3 "2020-02-03T15:58:21Z")

</div>

Hello!  
I was trying to do it in a “Theory” actually.  
Is this also possible?

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [February 3, 2020, 11:15pm UTC](https://www.finalbuilder.com/forums/t/import-xunit-tests-fails-for-skipped-tests/6712/4 "2020-02-03T23:15:38Z")

</div>

Hi @tdestro,

Can you provide an example of a test with attributes that does not work as expected?

The following test is skipped correctly in our tests:

```auto
[Theory(Skip = "Skipping as requirements are not clear")]
[InlineData(1)]
[MemberData(nameof(Data))]
[ClassData(typeof(TestData))]
public void Test_Skipping_With_Theory(int expectedValue)
{
	//Assert  
	Assert.NotEqual(expectedValue, int.MaxValue);
}

```

---

<div class="post-metadata">

### Author: ![tdestro](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/8baadc/32.png) [@tdestro](https://www.finalbuilder.com/forums/u/tdestro)
#### Post date: [February 4, 2020, 8:02am UTC](https://www.finalbuilder.com/forums/t/import-xunit-tests-fails-for-skipped-tests/6712/5 "2020-02-04T08:02:43Z")

</div>

This is the unit test code

```auto
        [Trait("Category", "Unit")]
        [Theory(DisplayName = "Theobald.Common.TryParseTime", Skip = "I want to skip this test")]
        [InlineData("c:\\myfile.dne", true)]
        public void DeleteFile(string fileName, bool fileExists)
        {
            IoHelper.DeleteFile(fileName);
            bool myReturn = System.IO.File.Exists(fileName);

            Assert.Equal(fileExists, myReturn);
        }

```

* * *

And this is the message that comes from continua:

Fail action if any tests fail: True  
Fail action if any tests error: True  
Error importing file [hidden\_path]\XUnitTestAdapter\Results.xml  
System.NullReferenceException: Object reference not set to an instance of an object. at Continua.Modules.Builds.Actions.UnitTest.XUnitParserHelper.ParseTestNode(IBuildSteppingContext context, List`1 unitTests, XElement test, String assemblyName, String fullClassName, String testName) at Continua.Modules.Builds.Actions.UnitTest.XUnitParserHelper.ParseReportV2XmlDocument(IBuildSteppingContext context, String reportFilename, XElement assembliesNode) at Continua.Modules.Builds.Actions.UnitTest.XUnitParserHelper.ParseReport(IBuildSteppingContext context) at Continua.Modules.Builds.Actions.ImportXUnitTestsAction.Execute(IBuildSteppingContext context).

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [February 4, 2020, 8:46am UTC](https://www.finalbuilder.com/forums/t/import-xunit-tests-fails-for-skipped-tests/6712/6 "2020-02-04T08:46:19Z")

</div>

OK, so there’s an error occurring when importing the results file.

We have just copied your unit test to our project and ran it through Continua CI DotNet Test action. We don’t see any errors importing the test using Import XUnit Tests action and the test is imported as a skipped test.

As we are unable to reproduce the error, we will need a copy of your test results xml file to investigate further.
