Giter Site home page Giter Site logo

Comments (3)

vbreuss avatar vbreuss commented on June 17, 2024 1

Fixed with #1013

from system.io.abstractions.

vbreuss avatar vbreuss commented on June 17, 2024

@rcdailey : Maybe you want to consider checking out Testably.Abstractions.Testing. I created an alternative mock file system that uses the same interface as System.IO.Abstractions, so it is compatible with your production code.
This issue is not present there, as the file system per default does not initialize anything, unless you explicitly tell it to.
Due to an extensive test suite that runs both against the mocked and against the real file system, it is much closer to the real file system also in edge cases.

from system.io.abstractions.

fgreinacher avatar fgreinacher commented on June 17, 2024

That's a good catch and something we did not anticipate in #372 and #590.

I would rather not change this behavior back because it seems to work for most users :)

I'd tend towards a new constructor with options like you suggested. Something like this:

public class MockFileSystemOptions
{
    string CurrentDirectory { get; init; } = ""
    bool CreateDefaultTempDir { get; init } = true
}


public MockFileSystem(IDictionary<string, MockFileData> files, MockFileSystemOptions options)

Happy to discuss further in a PR :)

from system.io.abstractions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.