public static async Task <Result <int> > RunFullSystemDiskCleanup()
        {
            var result = await DiskCleanup.RunFullDiskCleanup().ConfigureAwait(false);

            return(result.Match(unit => new Result <int>(0), exception =>
            {
                Logging.DefaultLogger.Error($"Failed to run full system disk cleanup. {exception.ToExceptionMessage()}");
                return new Result <int>(1);
            }));
        }
Beispiel #2
0
        public void RunFullDiskCleanupTest()
        {
            var actual = DiskCleanup.RunFullDiskCleanup();

            actual.Wait();
            actual.Result.Match(unit =>
            {
                Assert.IsTrue(true);
                return(Unit.Default);
            }, exception =>
            {
                Assert.Fail(exception.ToExceptionMessage());
                return(Unit.Default);
            });
        }