public void DeconstructTupleVarTest() { var _listName = new List <string>() { "Anna", "Elisabetta", "Giuseppe", "Laura", "Eugenio", "Ilaria", "Ugo", "Osvaldo", "Ada" }; var(startWithLetter, countA, countI, firstEName, countU, firstOName) = TuplesExample.CounterList(_listName); Assert.AreEqual(2, countA); Assert.AreEqual(1, countI); Assert.AreEqual("elisabetta", firstEName); Assert.AreEqual(1, countU); Assert.AreEqual("osvaldo", firstOName); Assert.AreEqual(2, startWithLetter.Count); }
public void CounterListTest() { var listName = new List <string>() { "Anna", "Elisabetta", "Giuseppe", "Laura", "Eugenio", "Ilaria", "Ugo", "Osvaldo", "Ada" }; var result = TuplesExample.CounterList(listName); Assert.AreEqual(2, result.countA); Assert.AreEqual(1, result.countI); Assert.AreEqual("elisabetta", result.firstEName); Assert.AreEqual(1, result.countU); Assert.AreEqual("osvaldo", result.firstOName); Assert.AreEqual(2, result.startWithLetter.Count); }