public async Task DoWorkAsync_OneTaskWithResult_ReturnsResult()
        {
            var funcTask = CreateTaskWithResult("test", 10);

            var result = await _deferral.DoWorkAsync(funcTask);

            Assert.Equal("test", result);
        }
        protected override Task <bool> IsNetworkAvailableInternalAsync()
        {
            return(TaskDeferral.DoWorkAsync(async() =>
            {
                var state = CrossConnectivity.Current.IsConnected && await CheckConnectionAsync().ConfigureAwait(false);

                TryToUpdateInternetResult(state);

                return IsInternetConnectionAvailable == true;
            }));
        }
Beispiel #3
0
        protected override Task <bool> IsNetworkAvailableInternalAsync()
        {
            return(TaskDeferral.DoWorkAsync(async() =>
            {
                var isHostReachable = await IsHostReachableAsync().ConfigureAwait(false);

                UpdateIsInternetConnectionAvailable(isHostReachable);

                return IsInternetConnectionAvailable == true;
            }));
        }