public void TestGetFileDrive() { var drives = DriveInfo.GetDrives(); var envDriveServiceMock = new Mock <IEnvironmentDriveService>(); envDriveServiceMock .Setup(m => m.GetMountedDrives()) .Returns(drives); var unmountedDriveServiceMock = new Mock <IUnmountedDriveService>(); unmountedDriveServiceMock .Setup(m => m.GetUnmountedDrivesAsync()) .ReturnsAsync(Array.Empty <UnmountedDriveModel>()); var configuration = new DriveServiceConfiguration { DrivesListRefreshIntervalMs = 10_000 }; var driveService = new DriveService(envDriveServiceMock.Object, unmountedDriveServiceMock.Object, configuration); var filePath = Assembly.GetEntryAssembly().Location; var drive = driveService.GetFileDrive(filePath); Assert.NotNull(drive); Assert.NotNull(drive.Name); Assert.NotNull(drive.RootDirectory); Assert.NotEmpty(drive.Name); Assert.NotEmpty(drive.RootDirectory); Assert.True(drive.FreeSpaceBytes > 0); Assert.True(drive.TotalSpaceBytes > 0); }