Example #1
0
        public void ValidateSortNonConsecutiveList()
        {
            var sortService = new SortService();
            var randomList  = GenerateRandomList(1000, 100);

            Assert.True(IsListOrdered(sortService.BubbleMethod(randomList)));
        }
Example #2
0
        public void ValidateSortReturnsSameLengthList()
        {
            var sortService = new SortService();
            var randomList  = GenerateRandomList(100);

            Assert.True(sortService.BubbleMethod(randomList)?.Count == randomList.Count);
        }
Example #3
0
        public void ValidateSortReturnsSameNumbers()
        {
            var sortService = new SortService();
            var randomList  = GenerateRandomList(100);

            Assert.True(sortService.BubbleMethod(randomList).Intersect(randomList).Any());
        }
Example #4
0
        public void ValidateSort()
        {
            var sortService = new SortService();

            Assert.Equal(sortedList, sortService.BubbleMethod(unsortedList));
        }
Example #5
0
        public void ValidateEmptyListPrameter()
        {
            var sortService = new SortService();

            Assert.Throws <ValidationException>(() => sortService.BubbleMethod(new List <int>()));
        }
Example #6
0
        public void ValidateNullParameter()
        {
            var sortService = new SortService();

            Assert.Throws <ValidationException>(() => sortService.BubbleMethod(null));
        }