Code Monkey home page Code Monkey logo

Comments (4)

tathamoddie avatar tathamoddie commented on May 29, 2024

I think this is beyond the scope of TestingHelpers.MockFileSystem. If you want to test specific interactions in an app, you should use IFileSystem with something like Moq or NSubstitute. MockFileSystem is just a helper for the 99% of cases to save you from having to mock out every last call manually. I'm worried that we're slowly growing the TestHelpers project into an entire in-memory file system.

from system.io.abstractions.

ericnewton76 avatar ericnewton76 commented on May 29, 2024

Well, once you had a list of file names and a pointer to their contents, it became an in-memory filesystem. The nice part is that Its a testable file system as well, since in theory, setting up these kinds of scenarios are what make for robust code.

We may have to specifically define what a basic filesystem is, or find a workable definition of it. I would guess that basic filesystem has out-of-space problems, since it has the job of allocating bytes on physical media that has finite space. I dont believe we have to keep track of blocks, but virtual sizes could be summed up and counted against a total size limit.

You could be right though... I believe that to the extent that as long as we dont introduce NTFS semantics into our code, we should be okay. For instance, I dont believe a basic filesystem would have ACLs. And quite possibly, filesystem locking (on the file level) wouldnt exist. Those would technically be mocked, and added to the mockfilesystem itself, since those are semantics associated with a more sophisticated filesystem.

I'm speaking out-of-turn in a sense, because I haven't seen the light on mocking frameworks... most examples I see is making a method in a test that returns exactly what you want, then turn around and test for it...

We should continue discussion.

from system.io.abstractions.

bacathey avatar bacathey commented on May 29, 2024

The Helpers are not technically Mocks. They are stubs and should be assumed to behave as such. Be aware that the behavior may not match the behavior expected based on experience with the real implementations. If you need something that is closer in behavior, build it out (and offer up a pull request to contribute back to the library).

Mocking frameworks are great ... :)

from system.io.abstractions.

jpreese avatar jpreese commented on May 29, 2024

Going to consider out of scope for now.

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.