Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autolabel bot test #3 #514

Closed
fgreinacher opened this issue Sep 27, 2019 · 1 comment
Closed

Autolabel bot test #3 #514

fgreinacher opened this issue Sep 27, 2019 · 1 comment

Comments

@fgreinacher
Copy link
Contributor

Using version 4.1.6 from NuGet, Windows, xUnit

  • In an xUnit test I have a MockFileSystem field
  • In the test constructor I have a MockFileSystem(IDictionary, string) constructor call
  • This constructor throws:
    • System.ArgumentOutOfRangeException : Index was out of range. Must be non-negative and less than the size of the collection.
    • Parameter name: startIndex
    • Stack trace: 
      • at System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)
      • at System.IO.Abstractions.TestingHelpers.MockFileSystem.AddDirectory(String path
      • at System.IO.Abstractions.TestingHelpers.MockFileSystem..ctor(IDictionary`2 files, String currentDirectory)

Relevant lines:

            _darkFile = Path.Combine("baseDir", "subDir", "darkFile");
            _brightFile = Path.Combine("baseDir", "subDir", "brightFile");
            _defectFile = Path.Combine("baseDir", "subDir", "defectFile");
            _correction = new Mock<ICorrection>();
            _fs = new MockFileSystem(
                new Dictionary<string, MockFileData>
                {
                    { _darkFile, new MockFileData(string.Empty) },
                    { _brightFile, new MockFileData(string.Empty) },
                    { _defectFile, new MockFileData(string.Empty) },
                }, "."); // When I use the default `""`, no exception is thrown
@issue-label-bot
Copy link

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant