}
}")
)
- .Returns(Task.FromResult(0));
+ .Returns(Task.CompletedTask);
twitterApi.apiConnection = mock.Object;
},
new Dictionary<string, IMediaItem> { { "media", media } })
)
- .Returns(Task.FromResult(0));
+ .Returns(Task.CompletedTask);
twitterApi.apiConnection = mock.Object;
new Uri("https://upload.twitter.com/1.1/media/metadata/create.json", UriKind.Absolute),
"{\"media_id\": \"12345\", \"alt_text\": {\"text\": \"hogehoge\"}}")
)
- .Returns(Task.FromResult(0));
+ .Returns(Task.CompletedTask);
twitterApi.apiConnection = mock.Object;
}
public override Task RefreshAsync(Twitter tw, bool backward, bool startup, IProgress<string> progress)
- => Task.FromResult(0); // 何もしない
+ => Task.CompletedTask; // 何もしない
}
}
}
public override Task RefreshAsync(Twitter tw, bool backward, bool startup, IProgress<string> progress)
- => Task.FromResult(0); // 何もしない
+ => Task.CompletedTask; // 何もしない
}
}
if (deepExpand)
this.ExpandTask = this.DeepExpandAsync();
else
- this.ExpandTask = Task.FromResult(0);
+ this.ExpandTask = Task.CompletedTask;
}
protected virtual async Task DeepExpandAsync()
private ShortcutCommand()
{
this.Shortcuts = Array.Empty<Keys>();
- this.command = () => Task.FromResult(0);
+ this.command = () => Task.CompletedTask;
this.onlyWhen = () => true;
this.FocusedOn = FocusedControl.None;
this.NotFocusedOn = FocusedControl.None;
return this.instance;
}
- /// <summary>何もしないタスク</summary>
- private static Task noOpTask = Task.FromResult(0);
-
/// <summary>
/// Action を Func<Task> に変換します
/// </summary>
private static Func<Task> SynchronousTask(Action action)
- => () => { action(); return noOpTask; };
+ => () => { action(); return Task.CompletedTask; };
}
}
}