Пример #1
0
        public async Task TestInsertionsSortLength()
        {
            Random r        = new Random();
            var    items    = Enumerable.Range(0, r.Next(500)).Select(x => r.Next(1000)).ToArray();
            var    sort     = new DotNetCoreSwap.Services.InsertionSort();
            var    response = await sort.IntSort(items);

            Assert.True(response.SortedArray.Length == items.Length);
        }
Пример #2
0
 public async Task TestEmptyArrayInsertionSort()
 {
     var sort = new DotNetCoreSwap.Services.InsertionSort();
     await Assert.ThrowsAsync <ArgumentNullException>(() => sort.IntSort(null));
 }