Ejemplo n.º 1
0
        public void ValidateSortNonConsecutiveList()
        {
            var sortService = new SortService();
            var randomList  = GenerateRandomList(1000, 100);

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

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

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

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

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

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