Esempio n. 1
0
        public async Task GetStorageDriveTestAsync(StorageUnit unit, double input, double expected)
        {
            const string drive = "sda/dev1";

            fixture.Customize(new SystemStorageCustomization(unit, input));
            SystemController mockController = fixture.Build <SystemController>()
                                              .OmitAutoProperties()
                                              .Create();

            Collection <StorageResult> result = await mockController.GetStorageDriveAsync(drive);

            // Value at time of writing was 5. Should always be more than 1.
            Assert.Single(result);
            Assert.Equal(expected, result[0].TotalSpace);
        }