},
"/statuses/home_timeline")
)
- .ReturnsAsync(new TwitterStatus[0]);
+ .ReturnsAsync(Array.Empty<TwitterStatus>());
twitterApi.apiConnection = mock.Object;
},
"/statuses/mentions_timeline")
)
- .ReturnsAsync(new TwitterStatus[0]);
+ .ReturnsAsync(Array.Empty<TwitterStatus>());
twitterApi.apiConnection = mock.Object;
},
"/statuses/user_timeline")
)
- .ReturnsAsync(new TwitterStatus[0]);
+ .ReturnsAsync(Array.Empty<TwitterStatus>());
twitterApi.apiConnection = mock.Object;
twitterApi.apiConnection = mock.Object;
- await twitterApi.StatusesUpdate("hogehoge", replyToId: null, mediaIds: null, excludeReplyUserIds: new long[0])
+ await twitterApi.StatusesUpdate("hogehoge", replyToId: null, mediaIds: null, excludeReplyUserIds: Array.Empty<long>())
.IgnoreResponse()
.ConfigureAwait(false);
},
"/lists/statuses")
)
- .ReturnsAsync(new TwitterStatus[0]);
+ .ReturnsAsync(Array.Empty<TwitterStatus>());
twitterApi.apiConnection = mock.Object;
},
"/users/lookup")
)
- .ReturnsAsync(new TwitterUser[0]);
+ .ReturnsAsync(Array.Empty<TwitterUser>());
twitterApi.apiConnection = mock.Object;
},
"/favorites/list")
)
- .ReturnsAsync(new TwitterStatus[0]);
+ .ReturnsAsync(Array.Empty<TwitterStatus>());
twitterApi.apiConnection = mock.Object;
null,
"/friendships/no_retweets/ids")
)
- .ReturnsAsync(new long[0]);
+ .ReturnsAsync(Array.Empty<long>());
twitterApi.apiConnection = mock.Object;
[Fact]
public void InitHashtagHistory_EmptyTest()
{
- var hashtags = new string[0];
+ var hashtags = Array.Empty<string>();
using (var atDialog = new AtIdSupplement())
using (var hashDialog = new HashtagManage(atDialog, hashtags, "", false, false, false))
public void AddHashtag_Test()
{
using (var atDialog = new AtIdSupplement())
- using (var hashDialog = new HashtagManage(atDialog, new string[0], "", false, false, false))
+ using (var hashDialog = new HashtagManage(atDialog, Array.Empty<string>(), "", false, false, false))
{
hashDialog.RunSilent = true;
public void AddHashtag_FullWidthTest()
{
using (var atDialog = new AtIdSupplement())
- using (var hashDialog = new HashtagManage(atDialog, new string[0], "", false, false, false))
+ using (var hashDialog = new HashtagManage(atDialog, Array.Empty<string>(), "", false, false, false))
{
hashDialog.RunSilent = true;
// ハッシュタグを表す「#」の直後に結合文字 (濁点など) が続いた場合に対するテスト
using (var atDialog = new AtIdSupplement())
- using (var hashDialog = new HashtagManage(atDialog, new string[0], "", false, false, false))
+ using (var hashDialog = new HashtagManage(atDialog, Array.Empty<string>(), "", false, false, false))
{
hashDialog.RunSilent = true;
public void AddHashtag_MultipleTest()
{
using (var atDialog = new AtIdSupplement())
- using (var hashDialog = new HashtagManage(atDialog, new string[0], "", false, false, false))
+ using (var hashDialog = new HashtagManage(atDialog, Array.Empty<string>(), "", false, false, false))
{
hashDialog.RunSilent = true;
public void AddHashtag_InvalidTest()
{
using (var atDialog = new AtIdSupplement())
- using (var hashDialog = new HashtagManage(atDialog, new string[0], "", false, false, false))
+ using (var hashDialog = new HashtagManage(atDialog, Array.Empty<string>(), "", false, false, false))
{
hashDialog.RunSilent = true;
public void EditModeSwitch_Test()
{
using (var atDialog = new AtIdSupplement())
- using (var hashDialog = new HashtagManage(atDialog, new string[0], "", false, false, false))
+ using (var hashDialog = new HashtagManage(atDialog, Array.Empty<string>(), "", false, false, false))
{
hashDialog.RunSilent = true;
[Fact]
public void GetUrlFromDataObject_UnknownFormatTest()
{
- using (var memstream = new MemoryStream(new byte[0]))
+ using (var memstream = new MemoryStream(Array.Empty<byte>()))
{
var data = new DataObject("application/x-hogehoge", memstream);
RetweetedBy = "";
Media = new List<MediaInfo>();
ReplyToList = new List<Tuple<long, string>>();
- QuoteStatusIds = new long[0];
- ExpandedUrls = new ExpandedUrlInfo[0];
+ QuoteStatusIds = Array.Empty<long>();
+ ExpandedUrls = Array.Empty<ExpandedUrlInfo>();
}
public string TextSingleLine
get => this._FilterBody;
set => this.SetProperty(ref this._FilterBody, value ?? throw new ArgumentNullException(nameof(value)));
}
- private string[] _FilterBody = new string[0];
+ private string[] _FilterBody = Array.Empty<string>();
[XmlArray("ExBodyFilterArray")]
public string[] ExFilterBody
get => this._ExFilterBody;
set => this.SetProperty(ref this._ExFilterBody, value ?? throw new ArgumentNullException(nameof(value)));
}
- private string[] _ExFilterBody = new string[0];
+ private string[] _ExFilterBody = Array.Empty<string>();
[XmlElement("SearchBoth")]
public bool UseNameField
lock (this.LockObj)
{
soundFile = "";
- notifyPosts = new PostClass[0];
+ notifyPosts = Array.Empty<PostClass>();
newMentionOrDm = false;
isDeletePost = false;
private readonly string contextScreenName;
/// <summary>自分が所有しているリスト</summary>
- private ListElement[] ownedLists = new ListElement[0];
+ private ListElement[] ownedLists = Array.Empty<ListElement>();
/// <summary>操作対象のユーザーが追加されているリストのID</summary>
- private long[] addedListIds = new long[0];
+ private long[] addedListIds = Array.Empty<long>();
public MyLists()
=> this.InitializeComponent();
/// <summary>
/// 振り分けルール (<see cref="MyCommon.TabUsageType.UserDefined"/> で使用)
/// </summary>
- public PostFilterRule[] FilterArray { get; set; } = new PostFilterRule[0];
+ public PostFilterRule[] FilterArray { get; set; } = Array.Empty<PostFilterRule>();
/// <summary>
/// 表示するユーザーのスクリーンネーム (<see cref="MyCommon.TabUsageType.UserTimeline"/> で使用)
private ShortcutCommand()
{
- this.Shortcuts = new Keys[0];
+ this.Shortcuts = Array.Empty<Keys>();
this.command = () => Task.FromResult(0);
this.onlyWhen = () => true;
this.FocusedOn = FocusedControl.None;
var item = xElm.XPathSelectElement("/response/posts/item[1]");
if (item == null)
- return new ThumbnailInfo[0];
+ return Array.Empty<ThumbnailInfo>();
var postUrlElm = item.Element("post_url");
{
return new ListViewSelection
{
- SelectedStatusIds = new long[0],
+ SelectedStatusIds = Array.Empty<long>(),
SelectionMarkStatusId = null,
FocusedStatusId = null,
};
}
}
- private ShortcutCommand[] shortcutCommands = new ShortcutCommand[0];
+ private ShortcutCommand[] shortcutCommands = Array.Empty<ShortcutCommand>();
private void InitializeShortcuts()
{
delegate void GetIconImageDelegate(PostClass post);
private readonly object LockObj = new object();
private ISet<long> followerId = new HashSet<long>();
- private long[] noRTId = new long[0];
+ private long[] noRTId = Array.Empty<long>();
//プロパティからアクセスされる共通情報
private List<string> _hashList = new List<string>();