scottoffen / grapevine-legacy

Embedding A REST Server In Your Application Should Be Simple
http://scottoffen.github.io/grapevine-legacy/
Apache License 2.0
209 stars 50 forks source link

Automated test should not use real filesystem #195

Closed Khubajsn closed 3 years ago

Khubajsn commented 6 years ago

The test AbsolutePathShouldNotChange in https://github.com/sukona/Grapevine/blob/master/src/Grapevine.Tests/Server/PublicFolderFacts.cs#L38 should not be relying on existence/contents of actual filesystem directory "C:\temp".

All required file system features should ideally be extracted into a separate interface and tests should work with its mock. At the very least, though, the test should use a directory path that's guaranteed to be empty/non-existing, such as a random + verified path in user's %TEMP%.

scottoffen commented 6 years ago

This is a good point. I had not considered that anyone else would be running my unit tests! I'd welcome a PR if you have a suggested fix.