mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
update
This commit is contained in:
27
luban_examples/Projects/CfgValidator/Modules/Mail.cs
Normal file
27
luban_examples/Projects/CfgValidator/Modules/Mail.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Linq;
|
||||
using CfgCheck;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace CfgCheck.Modules
|
||||
{
|
||||
[TestClass]
|
||||
public class Mail
|
||||
{
|
||||
[TestMethod]
|
||||
public void SystemMailAwardTest_NotEmpty()
|
||||
{
|
||||
// var mailConfig = ConfigSetUp.Configs.TbSystemMail;
|
||||
//
|
||||
// // 接下来就可以对邮件配置表进行check操作啦
|
||||
// // 下面是检查奖励是否为空的demo示例
|
||||
// // 建议测试用例的命名规则 使用 MethodName_ExpectedBehavior这样的方式
|
||||
//
|
||||
// var mailList = mailConfig.DataList;
|
||||
// foreach (var mailItem in mailList)
|
||||
// {
|
||||
// Assert.IsNotNull(mailItem.Award);
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
41
luban_examples/Projects/CfgValidator/Modules/Misc.cs
Normal file
41
luban_examples/Projects/CfgValidator/Modules/Misc.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using cfg.item;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace CfgCheck.Modules
|
||||
{
|
||||
[TestClass]
|
||||
public class Misc
|
||||
{
|
||||
|
||||
[TestMethod]
|
||||
public void Check_TreasureBoxConfig()
|
||||
{
|
||||
// foreach (var itemConfig in ConfigSetUp.Configs.TbItem.DataList)
|
||||
// {
|
||||
// var itemId = itemConfig.Id;
|
||||
// if (itemConfig.MajorType == EMajorType.TREASURE_BOX)
|
||||
// {
|
||||
// var boxConfig = (TreasureBox)ConfigSetUp.Configs.TbItemExtra.Get(itemId);
|
||||
// if (itemConfig.MinorType == EMinorType.TREASURE_BOX)
|
||||
// {
|
||||
// Assert.AreNotEqual(0, boxConfig.DropIds.Count, $"宝箱掉落列表不能为空. itemId:{itemId}");
|
||||
// }
|
||||
//
|
||||
// if (itemConfig.MinorType == EMinorType.MULTI_CHOOSE_TREASURE_BOX)
|
||||
// {
|
||||
// Assert.AreNotEqual(0, boxConfig.ChooseList.Count, $"多选宝箱 选择列表不能为空. itemId:{itemId}");
|
||||
//
|
||||
// foreach (var chooseConfig in boxConfig.ChooseList)
|
||||
// {
|
||||
// cfg.bonus.DropInfo dropConfig = ConfigSetUp.Configs.TbDrop.Get(chooseConfig.DropId);
|
||||
// Assert.IsTrue(dropConfig.Bonus is cfg.bonus.Item, $"多选宝箱:{itemId} 中的 掉落id:{chooseConfig.DropId} 对应的bonus必须为 Item 类型");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
48
luban_examples/Projects/CfgValidator/Modules/Role.cs
Normal file
48
luban_examples/Projects/CfgValidator/Modules/Role.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using cfg.item;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace CfgCheck.Modules
|
||||
{
|
||||
[TestClass]
|
||||
public class Role
|
||||
{
|
||||
[TestMethod]
|
||||
public void Check_LevelConsequence()
|
||||
{
|
||||
// int curLevel = 0;
|
||||
// foreach (var cfgLevel in ConfigSetUp.Configs.TbRoleLevelExpAttr.DataList)
|
||||
// {
|
||||
// ++curLevel;
|
||||
// Assert.AreEqual(curLevel, cfgLevel.Level, "等级定义不连续");
|
||||
// }
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Check_DropBonusItem_ShouldAllBeContainedInLevelCoefficientBonus()
|
||||
{
|
||||
// var CoefficientDropBonus = ConfigSetUp.Configs.TbDrop.DataList;
|
||||
// foreach (var dropItem in CoefficientDropBonus)
|
||||
// {
|
||||
// var curBonus = dropItem.Bonus;
|
||||
// if (curBonus is cfg.bonus.CoefficientItem c)
|
||||
// {
|
||||
// var bonusId = c.BonusId;
|
||||
// var bonusList = c.BonusList;
|
||||
// var dropTypeSet = bonusList.ItemList.Select(c => c.ItemId).Distinct();
|
||||
// var levelBonusCoefficientCfg = ConfigSetUp.Configs.TbRoleLevelBonusCoefficient.Get(bonusId).DistinctBonusInfos;
|
||||
// var bonusTypeSet = levelBonusCoefficientCfg.SelectMany(c => c.BonusInfo).Select(c => (int)c.Type).Distinct();
|
||||
// foreach (var item in dropTypeSet)
|
||||
// {
|
||||
// Assert.IsTrue(bonusTypeSet.Contains(item), $"类型{ConfigSetUp.Configs.TbItem.Get(item).MinorType} 没有在等级系数表里配置 等级系数奖励编号: {bonusId}");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user