You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingSystem.IO;usingXunit;namespaceSkippableTheoryAndMemberDataAndEmpty{publicclassParserTest{[SkippableTheory][MemberData(nameof(ProvideFiles))]publicvoidTestFile(stringfile){File.ReadAllText(file);// test this in own code...}publicstaticIEnumerable<object[]>ProvideFiles(){foreach(varfileinDirectory.GetFiles(".","*.file-extension")){yieldreturnnewobject[]{file};}}}}
dotnet test
Determining projects to restore...
All projects are up-to-date for restore.
SkippableTheoryAndMemberDataAndEmpty -> H:\Proj\SkippableTheoryAndMemberDataAndEmpty\SkippableTheoryAndMemberDataAndEmpty\bin\Debug\net6.0\SkippableTheoryAndMemberDataAndEmpty.dll
Test run for H:\Proj\SkippableTheoryAndMemberDataAndEmpty\SkippableTheoryAndMemberDataAndEmpty\bin\Debug\net6.0\SkippableTheoryAndMemberDataAndEmpty.dll (.NETCoreApp,Version=v6.0)
Microsoft (R) Test Execution Command Line Tool Version 17.3.0 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.47] SkippableTheoryAndMemberDataAndEmpty.ParserTest.TestFile [FAIL]
Failed SkippableTheoryAndMemberDataAndEmpty.ParserTest.TestFile [<1 ms]
Error Message:
System.InvalidOperationException : The test method expected 1 parameter value, but 0 parameter values were provided.
Failed! - Failed: 1, Passed: 0, Skipped: 0, Total: 1, Duration: <1 ms - SkippableTheoryAndMemberDataAndEmpty.dll (net6.0)
The exception message
System.InvalidOperationException : The test method expected 1 parameter value, but 0 parameter values were provided.
So is the idea that GetFiles produced an empty list? If so, why do you expect something other than an error? Theories are generally expected to run with at least 1 test case, and usually more.
Thanks for reply.
And sorry it was my misunderstand that SkippableTheory can work with empty list.
This is enough that this not problem of Xunit.SkippableFact. Sorry for taking your time.
I'll check more about Xunit itself.
ParserTest.cs
The exception message
I wonder why...
repo https://github.com/kenjiuno/SkippableTheoryAndMemberDataAndEmpty
The text was updated successfully, but these errors were encountered: