switch set, automatize more of the content without UI change
This commit is contained in:
@@ -1,76 +1,77 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
// using System;
|
||||
// using System.Collections;
|
||||
// using System.Collections.Generic;
|
||||
// using NUnit.Framework;
|
||||
// using Set.Data;
|
||||
|
||||
namespace Assets.Data
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestChampionUtils
|
||||
{
|
||||
[Test]
|
||||
[TestCaseSource(typeof(ChampionCase), "championsEnum")]
|
||||
public void TestIntChampion(long champlong)
|
||||
{
|
||||
var champs = ChampionUtils.FromLong(champlong);
|
||||
long output = ChampionUtils.ToLong(champs);
|
||||
Assert.IsTrue(champlong == output);
|
||||
}
|
||||
// namespace Tests.Editor
|
||||
// {
|
||||
// [TestFixture]
|
||||
// public class TestChampionUtils
|
||||
// {
|
||||
// [Test]
|
||||
// [TestCaseSource(typeof(ChampionCase), "championsEnum")]
|
||||
// public void TestIntChampion(long champlong)
|
||||
// {
|
||||
// var champs = ChampionUtils.FromLong(champlong);
|
||||
// long output = ChampionUtils.ToLong(champs);
|
||||
// Assert.IsTrue(champlong == output);
|
||||
// }
|
||||
|
||||
[Test]
|
||||
[TestCaseSource(typeof(ChampionCase), "championsNth")]
|
||||
public void TestGetNthChampion(long champlons, int n, long expected)
|
||||
{
|
||||
long output = ChampionUtils.GetNthChampion(champlons, n);
|
||||
Assert.IsTrue(output == expected);
|
||||
}
|
||||
}
|
||||
// [Test]
|
||||
// [TestCaseSource(typeof(ChampionCase), "championsNth")]
|
||||
// public void TestGetNthChampion(long champlons, int n, long expected)
|
||||
// {
|
||||
// long output = ChampionUtils.GetNthChampion(champlons, n);
|
||||
// Assert.IsTrue(output == expected);
|
||||
// }
|
||||
// }
|
||||
|
||||
public class ChampionCase
|
||||
{
|
||||
public static IEnumerable championsEnum
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return 1223456L;
|
||||
yield return 3422L;
|
||||
yield return 97352L;
|
||||
yield return 67855324254L;
|
||||
yield return 432742125L;
|
||||
yield return 76578256785L;
|
||||
yield return 12345678912345678L;
|
||||
}
|
||||
}
|
||||
// public class ChampionCase
|
||||
// {
|
||||
// public static IEnumerable championsEnum
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// yield return 1223456L;
|
||||
// yield return 3422L;
|
||||
// yield return 97352L;
|
||||
// yield return 67855324254L;
|
||||
// yield return 432742125L;
|
||||
// yield return 76578256785L;
|
||||
// yield return 12345678912345678L;
|
||||
// }
|
||||
// }
|
||||
|
||||
public static IEnumerable championsNth
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return new TestCaseData(
|
||||
ChampionUtils.ToLong(ChampionsEnum.ASHE),
|
||||
0,
|
||||
ChampionUtils.ToLong(ChampionsEnum.ASHE)
|
||||
);
|
||||
yield return new TestCaseData(
|
||||
ChampionUtils.ToLong(ChampionsEnum.SMOLDER),
|
||||
0,
|
||||
ChampionUtils.ToLong(ChampionsEnum.SMOLDER)
|
||||
);
|
||||
yield return new TestCaseData(
|
||||
ChampionUtils.ToLong(new HashSet<ChampionsEnum>() { ChampionsEnum.AHRI }),
|
||||
0,
|
||||
ChampionUtils.ToLong(ChampionsEnum.AHRI)
|
||||
);
|
||||
yield return new TestCaseData(
|
||||
ChampionUtils.ToLong(new HashSet<ChampionsEnum>() {
|
||||
ChampionsEnum.AHRI,
|
||||
ChampionsEnum.POPPY,
|
||||
ChampionsEnum.SORAKA,
|
||||
ChampionsEnum.HWEI }),
|
||||
1,
|
||||
ChampionUtils.ToLong(ChampionsEnum.SORAKA)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// public static IEnumerable championsNth
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// yield return new TestCaseData(
|
||||
// ChampionUtils.ToLong(ChampionsEnum.ASHE),
|
||||
// 0,
|
||||
// ChampionUtils.ToLong(ChampionsEnum.ASHE)
|
||||
// );
|
||||
// yield return new TestCaseData(
|
||||
// ChampionUtils.ToLong(ChampionsEnum.SMOLDER),
|
||||
// 0,
|
||||
// ChampionUtils.ToLong(ChampionsEnum.SMOLDER)
|
||||
// );
|
||||
// yield return new TestCaseData(
|
||||
// ChampionUtils.ToLong(new HashSet<ChampionsEnum>() { ChampionsEnum.AHRI }),
|
||||
// 0,
|
||||
// ChampionUtils.ToLong(ChampionsEnum.AHRI)
|
||||
// );
|
||||
// yield return new TestCaseData(
|
||||
// ChampionUtils.ToLong(new HashSet<ChampionsEnum>() {
|
||||
// ChampionsEnum.AHRI,
|
||||
// ChampionsEnum.POPPY,
|
||||
// ChampionsEnum.SORAKA,
|
||||
// ChampionsEnum.HWEI }),
|
||||
// 1,
|
||||
// ChampionUtils.ToLong(ChampionsEnum.SORAKA)
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user