public void AllCombinations_TestCombinations(int testCaseId, int[] blackSequences, int rowLength, string[] expectedResults) { var s = new PossibilitiesPossibilitiesSquareGroup(blackSequences, rowLength); var results = s.AllCombinations(); Assert.That(results.HasExactBitSets(expectedResults), Is.True); }
public void FilterCombinations_WithEmptyFilterLists_ReturnsAllCombinations() { var s = new PossibilitiesPossibilitiesSquareGroup(new[] { 1 }, 2); var allCombinations = s.AllCombinations(); var filteredCombinations = s.FilterCombinations(new PartiallyCompleteGroup(new BitGroup(31), new BitGroup(31))); Assert.That(allCombinations.HasExactBitSets(filteredCombinations)); }
public void AllCombinations_ForSingleBlackSequenceInRowOfLength2_ReturnsTwoCombinationsWithTheBlackSequenceInOppositeLocations() { var s = new PossibilitiesPossibilitiesSquareGroup(new[] { 1 }, 2); var results = s.AllCombinations(); Assert.That(results.Count, Is.EqualTo(2)); Assert.That(results.HasExactBitSets("10", "01"), Is.True); }
public void AllCombinations_ForSingleBlackSequenceInRowOfLength1_ReturnsSingleBlackSquare() { var s = new PossibilitiesPossibilitiesSquareGroup(new[] { 1 }, 1); var results = s.AllCombinations(); Assert.That(results.Count, Is.EqualTo(1)); Assert.That(results.First(), Is.EqualTo(new BitGroup(1, "1"))); }
public void AllCombinations_PerformanceTestForLongRow() { var s = new PossibilitiesPossibilitiesSquareGroup(new[] { 1, 1, 1, 1, 1, 1, 1, 1 }, 31); var t = new Stopwatch(); t.Start(); var results = s.AllCombinations(); t.Stop(); Assert.That(t.ElapsedMilliseconds, Is.LessThan(2000)); }