添加赛马测试

This commit is contained in:
milimoe 2025-07-30 23:24:28 +08:00
parent efcd0cb259
commit 4cfc56df38
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
2 changed files with 36 additions and 0 deletions

View File

@ -7,6 +7,7 @@ using Milimoe.FunGame.Testing.Tests;
using Oshima.FunGame.OshimaModules;
using Oshima.FunGame.OshimaModules.Models;
using Oshima.FunGame.OshimaModules.Regions;
using Oshima.FunGame.OshimaServers.Model;
using Oshima.FunGame.OshimaServers.Service;
using Oshima.FunGame.WebAPI.Controllers;
@ -29,6 +30,8 @@ FunGameService.InitFunGame();
FunGameSimulation.InitFunGameSimulation();
FunGameController controller = new(new Logger<FunGameController>(new LoggerFactory()));
HorseTest.HorseTest1();
StoreTest.StoreTest1();
await CharacterTest.CharacterTest2();

View File

@ -0,0 +1,33 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Oshima.FunGame.OshimaServers.Model;
using Oshima.FunGame.OshimaServers.Service;
namespace Milimoe.FunGame.Testing.Tests
{
public class HorseTest
{
public static void HorseTest1()
{
List<string> msgs = [];
while (true)
{
Room room = Factory.GetRoom(1, "1", gameMap: "1");
room.Name = "赛马房间";
for (int i = 0; i < 5; i++)
{
User user = Factory.GetUser();
user.Username = FunGameService.GenerateRandomChineseUserName();
room.UserAndIsReady.Add(user, true);
if (i == 0) room.RoomMaster = user;
}
HorseRacing.RunHorseRacing(msgs, room);
Console.WriteLine(string.Join("\r\n", msgs));
if (Console.ReadKey().Key == ConsoleKey.Escape)
{
break;
}
}
}
}
}