Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Mastodonクライアントの実装 #48

Draft
wants to merge 25 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8e74851
UserAccountクラスのプロパティ名等を変更
upsilon Apr 29, 2017
4cd9dd5
SettingCommonクラスのプロパティを整理, 使用されていないPasswordフィールドを削除
upsilon May 4, 2017
0193a5b
選択中のアカウントを UserAccount.Primary プロパティによって管理する
upsilon May 4, 2017
0be2f72
IsDistributableTabType,IsInnerStorageTabType をTabModelの型に基づいて判定する
upsilon May 5, 2017
e048c63
ツイートのふぁぼ・RT・削除の処理をPostClass派生クラスのメソッドとして実装
upsilon May 8, 2017
ce52bf0
PostClass.IsRetweetを追加, 公式RTでないツイートのRetweetedIdを参照すると例外を返す
upsilon Jun 9, 2017
73b3839
PostClass.HasInReplyTo を追加, リプライでないツイートのInReplyToStatusIdを参照すると例外を返す
upsilon Jun 10, 2017
3c472fa
Mastodon APIに対するリクエストを送信するMastodonApiConnectionを実装
upsilon Apr 29, 2017
0bc8fe1
Mastodon APIのJSONに含まれるエンティティの定義を追加
upsilon May 4, 2017
d25b433
Mastodon APIでのエラーレスポンスの詳細を例外メッセージに含める
upsilon May 19, 2017
3934eb3
SettingCommon.xmlにMastodonの認証情報の項目を追加
upsilon May 5, 2017
b1c7b9a
Mastodonのホームタイムラインを表示するMastodonHomeTabクラスを実装
upsilon May 6, 2017
c1c8bae
SettingCommon.xmlでMastodonの認証情報が設定されている場合は起動時にホームタイムラインを追加する
upsilon May 6, 2017
4c68b8d
Mastodonのトゥートのふぁぼ・ブースト・削除処理を実装
upsilon May 8, 2017
88c3819
Mastodonへのトゥートの投稿を実装
upsilon May 9, 2017
0f26a3b
トゥートに添付された画像のサムネイル表示に対応
upsilon May 11, 2017
19c7375
設定画面にMastodonアカウントに関するコントロールを追加
upsilon May 14, 2017
440d47d
設定画面にMastodonアカウントの認証機能を実装
upsilon May 16, 2017
b3997c9
事前に発行したMastodonのclient_id, client_secretの組をApplicetionSettings内に記述する
upsilon May 17, 2017
12f475d
Twitterアカウント未認証の状態でも起動できるように仮対応
upsilon Mar 7, 2020
e7a9c89
Mastodon対応版のバージョン表記を変更
upsilon Mar 7, 2020
3c8aea6
Mastodon対応の開発版ではアップデート確認を無効化
upsilon Mar 7, 2020
831b3c4
Twitter未認証かつMastodonアカウントが有効な場合はMastodonタブを起動時に選択する
upsilon Mar 7, 2020
001d56c
Twitter.AccountStateのチェックを無効化
upsilon Dec 1, 2022
7a1f327
GitHub Actionsでテスト失敗時の終了コードがジョブの成否に反映されない問題を修正
upsilon Dec 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
$altCoverPath = "$($env:NUGET_PACKAGES)\altcover\$($altCoverVersion)\tools\$($targetFramework)\AltCover.exe"
$xunitPath = "$($env:NUGET_PACKAGES)\xunit.runner.console\$($xunitVersion)\tools\$($targetFramework)\xunit.console.exe"

Start-Process `
$p = Start-Process `
-FilePath $altCoverPath `
-ArgumentList (
'--inputDirectory',
Expand All @@ -105,9 +105,14 @@ jobs:
'--visibleBranches'
) `
-NoNewWindow `
-PassThru `
-Wait

Start-Process `
if ($p.ExitCode -ne 0) {
exit $p.ExitCode
}

$p = Start-Process `
-FilePath $altCoverPath `
-ArgumentList (
'runner',
Expand All @@ -119,8 +124,13 @@ jobs:
'.\__Instrumented\OpenTween.Tests.dll'
) `
-NoNewWindow `
-PassThru `
-Wait

if ($p.ExitCode -ne 0) {
exit $p.ExitCode
}

- name: Upload test results to codecov
shell: pwsh
run: |
Expand Down
22 changes: 11 additions & 11 deletions OpenTween.Tests/Models/PostClassTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected override PostClass RetweetSource
{
get
{
var retweetedId = this.RetweetedId!.Value;
var retweetedId = this.RetweetedId;
var group = this.Group;
if (group == null)
throw new InvalidOperationException("TestPostClass needs group");
Expand Down Expand Up @@ -115,8 +115,8 @@ public void SetIsFavTest(long statusId, bool isFav)
post.IsFav = isFav;
Assert.Equal(isFav, post.IsFav);

if (post.RetweetedId != null)
Assert.Equal(isFav, this.postGroup[post.RetweetedId.Value].IsFav);
if (post.IsRetweet)
Assert.Equal(isFav, this.postGroup[post.RetweetedId].IsFav);
}

#pragma warning disable SA1008 // Opening parenthesis should be spaced correctly
Expand Down Expand Up @@ -144,9 +144,10 @@ public void StateIndexTest(bool protect, bool mark, bool reply, bool geo, int ex
{
IsProtect = protect,
IsMark = mark,
InReplyToStatusId = reply ? (long?)100L : null,
PostGeo = geo ? new PostClass.StatusGeo(-126.716667, -47.15) : (PostClass.StatusGeo?)null,
};
if (reply)
post.InReplyToStatusId = 100L;

Assert.Equal(expected, post.StateIndex);
}
Expand Down Expand Up @@ -213,9 +214,7 @@ public void DeleteTest()

post.IsDeleted = true;

Assert.Null(post.InReplyToStatusId);
Assert.Equal("", post.InReplyToUser);
Assert.Null(post.InReplyToUserId);
Assert.False(post.HasInReplyTo);
Assert.False(post.IsReply);
Assert.Empty(post.ReplyToList);
Assert.Equal(-1, post.StateIndex);
Expand Down Expand Up @@ -274,6 +273,7 @@ public void CanDeleteBy_RetweetedByMeTest()
{
var post = new TestPostClass
{
RetweetedId = 100L,
RetweetedByUserId = 111L, // 自分がリツイートした
UserId = 222L, // 他人のツイート
};
Expand All @@ -286,6 +286,7 @@ public void CanDeleteBy_RetweetedByOthersTest()
{
var post = new TestPostClass
{
RetweetedId = 100L,
RetweetedByUserId = 333L, // 他人がリツイートした
UserId = 222L, // 他人のツイート
};
Expand All @@ -298,6 +299,7 @@ public void CanDeleteBy_MyTweetHaveBeenRetweetedByOthersTest()
{
var post = new TestPostClass
{
RetweetedId = 100L,
RetweetedByUserId = 222L, // 他人がリツイートした
UserId = 111L, // 自分のツイート
};
Expand Down Expand Up @@ -386,17 +388,15 @@ public void ConvertToOriginalPost_Test()
Assert.Equal("@aaa", originalPost.ScreenName);
Assert.Equal(1L, originalPost.UserId);

Assert.Null(originalPost.RetweetedId);
Assert.Equal("", originalPost.RetweetedBy);
Assert.Null(originalPost.RetweetedByUserId);
Assert.False(originalPost.IsRetweet);
Assert.Equal(1, originalPost.RetweetedCount);
}

[Fact]
public void ConvertToOriginalPost_ErrorTest()
{
// 公式 RT でないツイート
var post = new PostClass { StatusId = 100L, RetweetedId = null };
var post = new PostClass { StatusId = 100L };

Assert.Throws<InvalidOperationException>(() => post.ConvertToOriginalPost());
}
Expand Down
Loading