mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-24 04:11:14 -10:00
* Fill out FileSystemInfo state when enumerating On Windows FileSystemInfos are filled in with state as we have all of the state from FindFirstFileEx. * Add more tests Refactor Time tests and add cases for refresh state. Fix positive attribute assertion. * Missed one of the cases * Tweaking the time tolerance didn't succeed. Putting it back to -3 seconds. * Refactor tests Gets coverage consistent Fixes test bug in DirectoryInfo where it was creating files for invalid attributes * Address feedback Commit migrated from https://github.com/dotnet/corefx/commit/9468aedba81b7d0b43f5545fc840a53544164694
29 lines
1.0 KiB
C#
29 lines
1.0 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace System.IO.Tests
|
|
{
|
|
public abstract class BaseGetSetAttributes : FileSystemTest
|
|
{
|
|
protected abstract FileAttributes GetAttributes(string path);
|
|
protected abstract void SetAttributes(string path, FileAttributes attributes);
|
|
|
|
/// <summary>
|
|
/// Create an appropriate filesystem object at the given path.
|
|
/// </summary>
|
|
protected virtual string CreateItem(string path = null, [CallerMemberName] string memberName = null, [CallerLineNumber] int lineNumber = 0)
|
|
{
|
|
path = path ?? GetTestFilePath(null, memberName, lineNumber);
|
|
File.Create(path).Dispose();
|
|
return path;
|
|
}
|
|
|
|
protected virtual void DeleteItem(string path) => File.Delete(path);
|
|
|
|
protected virtual bool IsDirectory => false;
|
|
}
|
|
}
|