Ejemplo n.º 1
0
        public void StringBucketSort()
        {
            var sort = new StringBucketSort(new BubbleSort());
            var test = SortData.Example1StringsInput;

            sort.Sort(test);
            for (var index = 0; index < SortData.Example1StringsOutput.Length; index++)
            {
                Assert.Equal(SortData.Example1StringsOutput[index], test[index]);
            }
        }
        public async Task ConcurrentStringBucketSort()
        {
            var sort   = new StringBucketSort(new BubbleSort());
            var test   = SortData.Example1StringsInput;
            var result = await sort.Sort(test, CancellationToken.None);

            for (var index = 0; index < SortData.Example1StringsOutput.Length; index++)
            {
                Assert.Equal(SortData.Example1StringsOutput[index], result[index]);
            }
        }