Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Release 2.1.3 #815

Merged
merged 18 commits into from
Dec 24, 2024
Merged
Changes from 1 commit
Commits
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
Next Next commit
update UTs
RayWangQvQ committed May 20, 2024
commit 0e2d15c97acf1cdf4ebcdb731bb03bc86a26a8e9
2 changes: 2 additions & 0 deletions test/LogTest/LogTest.csproj
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>

<UserSecretsId>5bc79f80-380e-4bcf-9c0b-30e98db3b935</UserSecretsId>
</PropertyGroup>

<ItemGroup>
2 changes: 0 additions & 2 deletions test/LogTest/TestCoolPush.cs
Original file line number Diff line number Diff line change
@@ -42,8 +42,6 @@ public void Test2()
CoolPushApiClient client = new CoolPushApiClient(_key);
var result = client.PushMessage(msg8);
Debug.WriteLine(result.Content.ReadAsStringAsync().Result);

System.Console.ReadLine();
}
}
}
2 changes: 0 additions & 2 deletions test/LogTest/TestDingTalk.cs
Original file line number Diff line number Diff line change
@@ -34,8 +34,6 @@ public void Test2()

var result = client.PushMessage(msg);
Debug.WriteLine(result.Content.ReadAsStringAsync().Result);

System.Console.ReadLine();
}
}
}
2 changes: 1 addition & 1 deletion test/LogTest/TestMicrosoftTeams.cs
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ public class TestMicrosoftTeams
public TestMicrosoftTeams()
{
Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");
Program.CreateHost(new string[] { });
Program.CreateHost(new string[] { "ENVIRONMENT=Development" });

_webhook = Global.ConfigurationRoot["Serilog:WriteTo:10:Args:webhook"];
}
2 changes: 0 additions & 2 deletions test/LogTest/TestPushPlus.cs
Original file line number Diff line number Diff line change
@@ -40,8 +40,6 @@ public void Test2()

var result = client.PushMessage(msg);
Debug.WriteLine(result.Content.ReadAsStringAsync().Result);

System.Console.ReadLine();
}
}
}
6 changes: 3 additions & 3 deletions test/LogTest/TestWorkWeiXin.cs
Original file line number Diff line number Diff line change
@@ -16,16 +16,16 @@ public class TestWorkWeiXin

public TestWorkWeiXin()
{
Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");
Program.CreateHost(new string[] { });
Environment.SetEnvironmentVariable("DOTNET_ENVIRONMENT", "Development");
Program.CreateHost(new string[] { "ENVIRONMENT=Development" });

_key = Global.ConfigurationRoot["Serilog:WriteTo:4:Args:webHookUrl"];
}

[Fact]
public void Test2()
{
WorkWeiXinApiClient client = new WorkWeiXinApiClient(_key);
var client = new WorkWeiXinApiClient(_key);

//string msg = LogConstants.Msg;
string msg = LogConstants.Msg2;
3 changes: 0 additions & 3 deletions test/LogTest/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -31,8 +31,6 @@ public void Test1()

logger.LogDebug(null);
logger.LogDebug("123{0}{1}", null, "haha");

System.Console.ReadLine();
}

[Fact]
@@ -53,7 +51,6 @@ public void Test2()
logger.LogInformation("-----全部任务已执行结束-----\r\n");

logger.LogInformation("开始推送");
System.Console.ReadLine();
}

private ILogger CreateLogger()
Original file line number Diff line number Diff line change
@@ -117,8 +117,10 @@ public async Task AddCoinForArticleAsync_Normal_Success()
BiliBiliAgent.Dtos.BiliApiResponse re = await _api.AddCoinForArticleAsync(req);

// Assert
re.Code.Should().Be(0);
re.Message.Should().BeEquivalentTo("0");
re.Code.Should().BeOneOf(
0,// 鎴愬姛
34005 // 瓒呰繃鎶曞竵涓婇檺鍟
);
}

#endregion
22 changes: 4 additions & 18 deletions test/Ray.BiliBiliTool.Agent.FunctionalTests/ChargeApiTest.cs
Original file line number Diff line number Diff line change
@@ -40,30 +40,16 @@ public async void ChargeV2Async_SendRequest_NotEnough()

// Assert
re.Code.Should().Be(0);
re.Data.Status.Should().Be(-4);
re.Data.Msg.Should().BeEquivalentTo("bp.to.battery http failed, invalid args, errNo=800409904: B 币余额不足");
re.Data.Status.Should().BeOneOf(
-4,//bp.to.battery http failed, invalid args, errNo=800409904: B 币余额不足
4
);
}

#endregion

#region ChargeCommentAsync

[Fact]
public async void ChargeCommentAsync_SendRequest_SetWridSuccess()
{
// Arrange
var upId = 220893216;
var req = new ChargeRequest(2, upId, _ck.BiliJct);

// Act
BiliApiResponse<ChargeV2Response> re = await _target.ChargeV2Async(req);

// Assert
re.Code.Should().Be(0);
re.Data.Status.Should().Be(-4);
re.Data.Msg.Should().BeEquivalentTo("bp.to.battery http failed, invalid args, errNo=800409904: B 币余额不足");
}

#endregion

}
Original file line number Diff line number Diff line change
@@ -61,10 +61,10 @@ public async Task ReceiveVipPrivilege_Normal_Success()
// Arrange

// Assert
re.Code.Should().BeOneOf(new List<int>
{
re.Code.Should().BeOneOf(
0,
73319, //todo: sort out meannings
});
69801 //浣犲凡棰嗗彇杩囪鏉冪泭
);
}
}