79278505

Date: 2024-12-13 13:43:12
Score: 0.5
Natty:
Report link

If each test only needs to have read access then you can share the read-only file between each execution by defining the FileAccess and FileShare constants.

string path = "./filepath";
FileParameter file = new(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read));
_ = await SomeFunction(file);
file.Data.Close();
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Ewan