Exemplo n.º 1
0
 public SnapOs(ISnapFilesystem snapFilesystem, ISnapOsProcessManager snapOsProcessManager, string workingDirectory, bool isUnitTest)
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         OsImpl = new SnapOsWindows(snapFilesystem, snapOsProcessManager, isUnitTest ?
                                    (ISnapOsSpecialFolders) new SnapOsSpecialFoldersUnitTest(snapFilesystem, workingDirectory) : new SnapOsSpecialFoldersWindows(), isUnitTest);
     }
     else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
     {
         OsImpl = new SnapOsUnix(snapFilesystem, snapOsProcessManager, isUnitTest ?
                                 (ISnapOsSpecialFolders) new SnapOsSpecialFoldersUnitTest(snapFilesystem, workingDirectory) : new SnapOsSpecialFoldersUnix());
     }
     else
     {
         throw new PlatformNotSupportedException();
     }
 }
Exemplo n.º 2
0
 public SnapOs(ISnapOsImpl snapOsImpl)
 {
     OsImpl = snapOsImpl ?? throw new ArgumentNullException(nameof(snapOsImpl));
 }