public void CPreOneTest() { var arena = new Arena(); arena.AddPlayerZeroNode(0); arena.AddPlayerOneNode(1); arena.AddPlayerZeroNode(2); arena.AddEdge(0, 1); arena.AddEdge(1, 2); arena.AddEdge(1, 1); arena.AddEdge(2, 0); var zeroSet = new HashSet <int>(); zeroSet.Add(0); var oneSet = new HashSet <int>(); oneSet.Add(1); var twoSet = new HashSet <int>(); twoSet.Add(2); Assert.IsTrue(arena.CPreOne(oneSet).getWinningRegion().Count == 2 && arena.CPreOne(oneSet).getWinningRegion().Contains(1) && arena.CPreOne(oneSet).getWinningRegion().Contains(0)); Assert.IsTrue(arena.CPreOne(twoSet).getWinningRegion().Count == 1 && arena.CPreOne(twoSet).getWinningRegion().Contains(1)); }
public void CPreOneTest() { var arena = new Arena(); arena.AddPlayerZeroNode(0); arena.AddPlayerOneNode(1); arena.AddPlayerZeroNode(2); arena.AddEdge(0, 1); arena.AddEdge(1, 2); arena.AddEdge(1, 1); arena.AddEdge(2, 0); var zeroSet = new HashSet<int>(); zeroSet.Add(0); var oneSet = new HashSet<int>(); oneSet.Add(1); var twoSet = new HashSet<int>(); twoSet.Add(2); Assert.IsTrue(arena.CPreOne(oneSet).getWinningRegion().Count == 2 && arena.CPreOne(oneSet).getWinningRegion().Contains(1) && arena.CPreOne(oneSet).getWinningRegion().Contains(0)); Assert.IsTrue(arena.CPreOne(twoSet).getWinningRegion().Count == 1 && arena.CPreOne(twoSet).getWinningRegion().Contains(1)); }