public void Setup() { m_origOs = (IFileOS)ReflectionHelper.GetField(typeof(FileUtils), "s_fileos"); // Need a new one each time so tests don't affect each other. m_fileOs = new MockFileOS(); ReflectionHelper.SetField(typeof(FileUtils), "s_fileos", m_fileOs); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Sets the IFileOS adapter. /// </summary> /// ------------------------------------------------------------------------------------ public static void SetFileAdapter(IFileOS adapter) { s_fileos = adapter; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes the <see cref="FileUtils"/> class. /// </summary> /// ------------------------------------------------------------------------------------ static FileUtils() { s_fileos = new SystemIOProxy(); }