public void Repl_BinaryTuple_Empty() { var expected = Enumerable.Empty <Tuple <char, char> >(); char[] iterable = "A".ToCharArray(); List <Tuple <char, char> > actual = Nitre.CombinationsBinary(iterable).ToList(); Assert.Equal(expected, actual); }
public void VerifiedExample() { var iterables = "ABCD".ToCharArray(); var actual = Nitre.CombinationsBinary(iterables).Select(item => new string(new char[] { item.Item1, item.Item2 })); var expected = new List <string> { "AB", "AC", "AD", "BC", "BD", "CD" }; Assert.Equal(expected, actual); }
public void Repl_BinaryTuple() { List <Tuple <char, char> > expected = new List <Tuple <char, char> > { Tuple.Create('A', 'B'), Tuple.Create('A', 'C'), Tuple.Create('A', 'D'), Tuple.Create('B', 'C'), Tuple.Create('B', 'D'), Tuple.Create('C', 'D') }; char[] iterable = "ABCD".ToCharArray(); List <Tuple <char, char> > actual = Nitre.CombinationsBinary(iterable).ToList(); // var actual_ = partialResult.Select(r => new string(new char[] { r.Item1, r.Item2 })); // Assert.False(true); Assert.Equal(expected, actual); }