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

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

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

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

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

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

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