-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 基本完成升级时间计算的升级,并增加一个单元测试。 * 调整了升级时间的日志描述
- Loading branch information
1 parent
171c895
commit ef6ea12
Showing
3 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Ray.BiliBiliTool.Agent.BiliBiliAgent.Dtos; | ||
|
||
namespace DomainServiceTest; | ||
|
||
public class CalculateUpgradeTimeTest | ||
{ | ||
public CalculateUpgradeTimeTest() | ||
{ | ||
Program.CreateHost(new[] { "--ENVIRONMENT=Development" }); | ||
} | ||
|
||
[Fact] | ||
public void TestCalculateUpgradeTime() | ||
{ | ||
using var scope = Global.ServiceProviderRoot.CreateScope(); | ||
var accountDomainService = scope.ServiceProvider.GetRequiredService<IAccountDomainService>(); | ||
int needDay = accountDomainService.CalculateUpgradeTime(new UserInfo() | ||
{ | ||
Money = 7, | ||
Level_info = new LevelInfo() | ||
{ | ||
Current_level = 5, | ||
Current_exp = 100, | ||
Next_exp = 200 | ||
} | ||
}); | ||
int needDay2 = accountDomainService.CalculateUpgradeTime(new UserInfo() | ||
{ | ||
Money = 7, | ||
Level_info = new LevelInfo() | ||
{ | ||
Current_level = 5, | ||
Current_exp = 1000, | ||
Next_exp = 2000 | ||
} | ||
}); | ||
|
||
Assert.Equal(1,needDay); | ||
Assert.Equal(37,needDay2); | ||
|
||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|