public void KnockoutRoundNames() { Assert.AreEqual(KnockoutPlanner.GetRoundName(1, 4, null), "Octavos de final"); Assert.AreEqual(KnockoutPlanner.GetRoundName(2, 4, null), "Cuartos de final"); Assert.AreEqual(KnockoutPlanner.GetRoundName(3, 4, null), "Semifinales"); Assert.AreEqual(KnockoutPlanner.GetRoundName(4, 4, null), "Final"); }
public void KnockoutPowerOfTwoTest() { try { var fields = new Field[] { new Field { Id = 1001, Name = "Campo1" }, new Field { Id = 1002, Name = "Campo2" } }; var input = GetKnockOutInput(14); var result = KnockoutPlanner.Calculate(input, fields, "es", null); Assert.Fail("Should raise exception, numTeams not power of 2"); } catch (PlannerException ex) { if (ex.Message == "Error.NotPowerOfTwo") { return; } } Assert.Fail("Expected exception not thrown"); }
public void KnockoutBasicTest() { var teamIds = new long[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; var r = KnockoutPlanner.CreateRounds(teamIds, new GroupCoords { IdTournament = 1, IdStage = 2, IdGroup = 3 }); Assert.IsNotNull(r); Assert.IsTrue(CheckMatchList(r[0], new long[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 })); }
public void KnockoutSchedule() { var fields = new Field[] { new Field { Id = 1001, Name = "Campo1" }, new Field { Id = 1002, Name = "Campo2" } }; var input = GetKnockOutInput(8); var result = KnockoutPlanner.Calculate(input, fields, "es", null); Assert.IsNotNull(result); Assert.IsNotNull(result.Days); Assert.AreEqual(result.Days.Count, 3); }