public void Add100_RandomDelete20() { var random = new Random(); for (var i = 0; i < 100; i++) { _mostlyFullSequence.Add(); } var listOfDeletedNums = new List <int>(); listOfDeletedNums.Add(0); for (var i = 0; i < 10; i++) { var randomNumberToDelete = 0; while (listOfDeletedNums.Contains(randomNumberToDelete)) { randomNumberToDelete = random.Next(0, 100 - i); } listOfDeletedNums.Add(randomNumberToDelete); _mostlyFullSequence.DeleteAt(randomNumberToDelete); } listOfDeletedNums.Sort(); foreach (var i in listOfDeletedNums) { Console.Write($"{i} "); } Console.WriteLine(); Console.WriteLine(); var internalList = _mostlyFullSequence.GetInternaList(); for (var i = 0; i < internalList.Count; i++) { if (i % 2 == 0) { Console.Write($"{internalList[i]}-"); } else { Console.Write($"{internalList[i]} "); } } }
public void Delete_NoValues_ExceptionOccurs() { Assert.That(() => _mostlyFullSequence.DeleteAt(1), Throws.TypeOf <InvalidOperationException>()); }