public void GenericSortTest()
        {
            var sortingService = new SortingService(new ExpressionBuilder());

            var vm = new SortingModel();

            vm.SortingColumnCurrent = "";
            vm.ShouldReOrder        = true;
            vm.SortingColumnNew     = "BornDate";
            vm.SortingOrderCurrent  = SortingOrder.Ascending;


            var resultSet = sortingService.GenericSortQuery <Person>(Persons.AsQueryable(), vm);

            Assert.IsTrue(resultSet.FirstOrDefault().Name.Equals("kelly"));

            // same column is clicked, order changed
            resultSet = sortingService.GenericSortQuery <Person>(Persons.AsQueryable(), vm);
            Assert.IsTrue(resultSet.FirstOrDefault().Name.Equals("joe"));

            //different column is clicked, ascending as default
            vm.SortingColumnNew = "Name";
            vm.ShouldReOrder    = true;
            resultSet           = sortingService.GenericSortQuery <Person>(Persons.AsQueryable(), vm);
            Assert.IsTrue(resultSet.FirstOrDefault().Name.Equals("anna"));
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Bubble Sort --------------------------");
            System.Numerics.BigInteger[] numbers = { 2, 5, 7, 1, 5, 6, 18, 15, 16, 14 };
            SortingService sortingService        = new SortingService();

            foreach (int number in numbers)
            {
                Console.Write(number + " ");
            }
            Console.WriteLine("");
            Console.WriteLine("Sorted:");
            sortingService.BubbleSort(numbers);
            foreach (int number in numbers)
            {
                Console.Write(number + " ");
            }

            Console.WriteLine("");
            Console.WriteLine("Binary Search --------------------------");
            BinarySearchService binarySearch = new BinarySearchService();

            System.Numerics.BigInteger result;
            binarySearch.BinarySearch(numbers, 7, out result);
            Console.WriteLine(result);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                Console.WriteLine("Please add a file as a parameter.");
                Console.ReadKey();
                return;
            }

            // Get Input and Output files.
            string inputFile = args[0];

            Console.WriteLine("sort-names " + inputFile);
            string textToAppend = ConfigurationManager.AppSettings["TextToAppend"];
            string outputFile   = FileHelper.GetOutputFileName(inputFile, textToAppend);

            // Parse and Sort.
            List <Person> people = FileHelper.ParseFileToPersonList(inputFile);

            people = SortingService.SortPeopleByLastName(people);

            // Output and Respond.
            FileHelper.OutputPeopleToFile(outputFile, people);
            Console.WriteLine("Finished: created " + Path.GetFileName(outputFile));
            Console.WriteLine("");
            Console.ReadKey();
        }
        public void TestGetValueAsc()
        {
            // Arrange
            SortingService service = new SortingService();

            int expectedLowestKey = 22;
            int actualLowestKey = -1;

            int expectedLowestTotal = 29;
            int actualLowestTotal = -1;

            int expectedHighestKey = 0;
            int actualHighestKey = -1;

            int expectedHighestTotal = 52;
            int actualHighestTotal = -1;

            // Act
            List<KeyTotal> keyTotals = service.GetValueAsc(RandomNumbers());

            KeyTotal lowestKeyTotal = keyTotals[0];
            actualLowestKey = lowestKeyTotal.Key;
            actualLowestTotal = lowestKeyTotal.Total;

            KeyTotal highestKeyTotal = keyTotals[keyTotals.Count - 1];
            actualHighestKey = highestKeyTotal.Key;
            actualHighestTotal = highestKeyTotal.Total;

            // Assert
            Assert.AreEqual(expectedLowestKey, actualLowestKey);
            Assert.AreEqual(expectedLowestTotal, actualLowestTotal);

            Assert.AreEqual(expectedHighestKey, actualHighestKey);
            Assert.AreEqual(expectedHighestTotal, actualHighestTotal);
        }
        public void DescendingSortExecuted()
        {
            var movies = new List <MovieDto>();

            var movie = new MovieDto();

            movie.Title = "B";
            movie.Cast  = new List <string> {
                "Bird", "Penguin"
            };

            movies.Add(movie);

            movie       = new MovieDto();
            movie.Title = "A";
            movie.Cast  = new List <string> {
                "Abstraction", "NonConcreation"
            };

            movies.Add(movie);

            var factory  = Mock.Of <ISortingStrategyFactory>();
            var strategy = Mock.Of <ISortingStrategy>();

            Mock.Get(factory).Setup(f => f.Get(SortingItems.Title)).Returns(strategy);

            var sorter = new SortingService(factory);

            sorter.Sort("-title", movies);

            Mock.Get(factory).Verify(f => f.Get(SortingItems.Title), Times.Once);
            Mock.Get(strategy).Verify(s => s.OrderBy(SortingDirections.Descending, movies), Times.Once);
        }
Beispiel #6
0
        public void SortReferringSitesTests()
        {
            const int    largestTotalCount       = 1000;
            const int    largestTotalUniqueCount = 11;
            const string lastReferer             = "t.co";

            //Arrange
            var referringSitesList = new List <MobileReferringSiteModel>
            {
                new MobileReferringSiteModel(new ReferringSiteModel(10, 10, "Google")),
                new MobileReferringSiteModel(new ReferringSiteModel(10, 10, "codetraver.io")),
                new MobileReferringSiteModel(new ReferringSiteModel(10, 10, lastReferer)),
                new MobileReferringSiteModel(new ReferringSiteModel(100, largestTotalUniqueCount, "facebook.com")),
                new MobileReferringSiteModel(new ReferringSiteModel(100, 9, "linkedin.com")),
                new MobileReferringSiteModel(new ReferringSiteModel(largestTotalCount, 9, "reddit.com"))
            };

            //Act
            var sortedReferringSitesList = SortingService.SortReferringSites(referringSitesList);

            //Assert
            Assert.IsTrue(sortedReferringSitesList.First().TotalCount is largestTotalCount);
            Assert.IsTrue(sortedReferringSitesList.Skip(1).First().TotalUniqueCount is largestTotalUniqueCount);
            Assert.IsTrue(sortedReferringSitesList.Last().Referrer is lastReferer);
        }
        public void ThrowArgumentExceptionIfSourceIsNull()
        {
            var factory = Mock.Of <ISortingStrategyFactory>();

            var sorter = new SortingService(factory);

            sorter.Sort("any", null);
        }
        public void ThrowArgumentExceptionIfSortByIsNull()
        {
            var factory = Mock.Of <ISortingStrategyFactory>();

            var sorter = new SortingService(factory);

            sorter.Sort(null, new List <MovieDto>());
        }
        public void CanCreateSortingService()
        {
            var factory = Mock.Of <ISortingStrategyFactory>();

            var sorter = new SortingService(factory);

            Assert.IsNotNull(sorter);
        }
Beispiel #10
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var sortingServiceInstance = new SortingService();
            var controller             = new FormsMVCController(sortingServiceInstance);

            Application.Run(controller.View);
        }
Beispiel #11
0
        public async Task ApplySortingAsync_WithInvalidSorter_Should_Throw(SorterTypes sortType)
        {
            var value  = "bacsdasdwea";
            var sorter = new SortingService();
            var model  = new FormsMVCModel {
                Input = value, SortType = sortType
            };

            var task = Task.Run(() => sorter.ApplySortingAsync(model));

            await Assert.ThrowsExceptionAsync <TypeLoadException>(() => task);
        }
Beispiel #12
0
        public void ApplySorting_WithInvalidSorter_Should_Throw(SorterTypes sortType)
        {
            var value  = "bacsdasdwea";
            var sorter = new SortingService();
            var model  = new FormsMVCModel {
                Input = value, SortType = sortType
            };

            Action act = () => sorter.ApplySorting(model);

            Assert.ThrowsException <TypeLoadException>(act);
        }
Beispiel #13
0
        public async Task ApplySortingAsync_Should_Sort_Input(SorterTypes sortType)
        {
            var value         = "bacsdasdwea";
            var expectedValue = "aaabcddessw";
            var sorter        = new SortingService();
            var model         = new FormsMVCModel {
                Input = value, SortType = sortType
            };

            var result = await sorter.ApplySortingAsync(model);

            Assert.AreEqual(expectedValue, result);
        }
Beispiel #14
0
        public void PointsShouldBeSortedReverseByX()
        {
            var _sortingService = new SortingService();

            Point p1 = new Point(0, 0);
            Point p2 = new Point(2, 2);

            List <Point> pointsList = new List <Point> {
                p1, p2
            };

            pointsList = _sortingService.GetSortedPointsList(pointsList, true, "x");

            Assert.Equal(pointsList[0].X, 2);
        }
Beispiel #15
0
        public void PointsShouldBeSortedByY()
        {
            var _sortingService = new SortingService();

            Point p1 = new Point(0, 4);
            Point p2 = new Point(-2, 2);

            List <Point> pointsList = new List <Point> {
                p1, p2
            };

            pointsList = _sortingService.GetSortedPointsList(pointsList, false, "y");

            Assert.Equal(pointsList[0].Y, 2);
        }
        public void MultiFieldsSortingWithDescendingOrderCorrect()
        {
            var movies = new List <MovieDto>();

            var movieB17 = new MovieDto();

            movieB17.Title   = "B";
            movieB17.MovieId = 17;
            movies.Add(movieB17);

            var movieB15 = new MovieDto();

            movieB15.Title   = "B";
            movieB15.MovieId = 15;
            movies.Add(movieB15);

            var movieAb = new MovieDto();

            movieAb.Title   = "AB";
            movieAb.MovieId = 10;
            movies.Add(movieAb);

            var movieAa2 = new MovieDto();

            movieAa2.Title   = "AA";
            movieAa2.MovieId = 2;
            movies.Add(movieAa2);

            var movieAa1 = new MovieDto();

            movieAa1.Title   = "AA";
            movieAa1.MovieId = 1;
            movies.Add(movieAa1);

            var movieAa3 = new MovieDto();

            movieAa3.Title   = "AA";
            movieAa3.MovieId = 3;
            movies.Add(movieAa3);


            var sorter = new SortingService(new SortingStrategyFactory());

            movies = sorter.Sort("-title,movieid", movies);

            Assert.IsTrue(movies.First() == movieB15);
            Assert.IsTrue(movies.Last() == movieAa3);
        }
        public async Task SortAndSaveNumbers_shouldReturnSortedtring(string input, string expected)
        {
            const string fileName = "file01.txt";

            var mockFileService = new Mock <IFileService>();

            mockFileService
            .Setup(f => f.SaveToFile(It.IsAny <string>()))
            .ReturnsAsync(fileName);

            var sortingService = new SortingService(mockFileService.Object);

            SavedData result = await sortingService.Create(new SortingInput { Line = input });

            Assert.Equal(expected, result.OrderedNumbers);
            Assert.Equal(fileName, result.FileName);
        }
Beispiel #18
0
        private static void _fileWatcher_Changed(object sender, FileSystemEventArgs e)
        {
            _fileWatcher.EnableRaisingEvents = false;

            Logger.CreateLog("Config changed. Reinit...");
            foreach (var entry in SortingService.Instances)
            {
                entry.Stop();
            }

            SortingService.Instances = new List <SortingService>();

            ReadConfig();
            SortingService.InitServices();

            _fileWatcher.EnableRaisingEvents = true;
        }
        public void SortPeopleByLastNameTests()
        {
            List <Person> unsortedPeople = new List <Person>();

            var personTheo = new Person("THEODORE", "BAKER");
            var personFred = new Person("FREDRICK", "SMITH");

            unsortedPeople.Add(new Person("ANDREW", "SMITH"));
            unsortedPeople.Add(personTheo);
            unsortedPeople.Add(personFred);
            unsortedPeople.Add(new Person("MADISON", "KENT"));

            var sortedPeople = SortingService.SortPeopleByLastName(unsortedPeople);

            Assert.AreEqual(sortedPeople.First().OutputName, personTheo.OutputName);
            Assert.AreEqual(sortedPeople.Last().OutputName, personFred.OutputName);
        }
Beispiel #20
0
        /// <summary>
        /// Добавить отработанные часы, вызов метода происходит из объекта класса Staff.
        /// </summary>
        private static void Staff_EventAddWorkHours(Staff staff)
        {
            List <string>  listHoursWorked = new List <string>();
            SortingService sortSrv         = new SortingService();

            FileIOService file = new FileIOService("Список отработанных часов сотрудников на зарплате");

            file.AddStringToFile(Output.AddHoursWorked((Employee)staff));

            listHoursWorked = file.LoadListOfHoursWorked();

            if (sortSrv.NeedSorting(listHoursWorked))
            {
                listHoursWorked = sortSrv.SortingList(listHoursWorked);
            }

            file.OverwriteListOfHoursWorkedToFile(sortSrv.FindDuplicateLines(listHoursWorked));
        }
Beispiel #21
0
 public ExtendedNotificationService(IAnalyticsService analyticsService,
                                    DeepLinkingService deepLinkingService,
                                    SortingService sortingService,
                                    AzureFunctionsApiService azureFunctionsApiService,
                                    IPreferences preferences,
                                    ISecureStorage secureStorage,
                                    INotificationManager notificationManager,
                                    INotificationService notificationService) :
     base(analyticsService,
          deepLinkingService,
          sortingService,
          azureFunctionsApiService,
          preferences,
          secureStorage,
          notificationManager,
          notificationService)
 {
 }
Beispiel #22
0
        /// <summary>
        /// Добавить отработанные часы, вызов метода происходит из объекта класса Freelancer.
        /// </summary>
        private static void Freelancer_EventAddWorkHours(Freelancer freelancer)
        {
            List <string>  listHoursWorked = new List <string>();
            SortingService sortSrv         = new SortingService();

            FileIOService file = new FileIOService("Список отработанных часов внештатных сотрудников");

            file.AddStringToFile(Output.AddHoursWorked((Employee)freelancer));

            listHoursWorked = file.LoadListOfHoursWorked();

            if (sortSrv.NeedSorting(listHoursWorked))
            {
                listHoursWorked = sortSrv.SortingList(listHoursWorked);
            }

            file.OverwriteListOfHoursWorkedToFile(sortSrv.FindDuplicateLines(listHoursWorked));
        }
        public void TestGetKeyDesc()
        {
            // Arrange
            SortingService service = new SortingService();

            string actual = null;
            string expected = "24: 34 keer\n23: 38 keer\n22: 29 keer\n21: 37 keer\n20: 41 keer\n" +
                "19: 39 keer\n18: 45 keer\n17: 38 keer\n16: 35 keer\n15: 39 keer\n14: 44 keer\n" +
                "13: 42 keer\n12: 44 keer\n11: 35 keer\n10: 43 keer\n9: 48 keer\n8: 36 keer\n" +
                "7: 39 keer\n6: 38 keer\n5: 36 keer\n4: 43 keer\n3: 48 keer\n2: 37 keer\n1: 40 keer\n" +
                "0: 52 keer";

            // Act
            actual = service.GetKeyDesc(RandomNumbers());

            // Assert
            Assert.AreEqual(expected, actual);
        }
        public async Task GetLatestData()
        {
            string numbers = "1 5 6";
            string path    = "file01.txt";

            var mockFileService = new Mock <IFileService>();

            mockFileService
            .Setup(f => f.ReadFromLastAvailableFile(It.IsAny <Stack <FileInfo> >()))
            .ReturnsAsync(new Tuple <string, string>(numbers, path));

            var sortingService = new SortingService(mockFileService.Object);

            SavedData result = await sortingService.GetLatestData();

            Assert.Equal(numbers, result.OrderedNumbers);
            Assert.Equal(path, result.FileName);
        }
Beispiel #25
0
        /// <summary>
        /// 加载系统设置信息
        /// </summary>
        private static void LoadSystemSetting()
        {
            try
            {
                //获取系统设置信息
                _systemSetting = BaseDataService.GetSystemSetting();

                //串口服务实例化
                SerialPortService = SerialPortService.Instance(_systemSetting.ModbusSetting, GetSlaveConfig(), _systemSetting.WarningCabinetId);

                //分拣数据服务实例化
                sortingService = new SortingService(_systemSetting.CabinetNumber, _systemSetting.SortingPatten, _systemSetting.SortingSolution, _systemSetting.InterfaceType, _systemSetting.BoxWeight);
                //声音服务
                soundService = new SoundService();
            }
            catch (Exception ex)
            {
                SaveErrLogHelper.SaveErrorLog(string.Empty, ex.ToString());
            }
        }
Beispiel #26
0
        static void Main(string[] args)
        {
            bool isFinish = false;

            do
            {
                switch (Menu.ActionMenu())
                {
                case Actions.Add:
                    switch (Menu.AddMenu())
                    {
                    case Services.Models.Band:
                        ModelCreator.CreateAndSaveBand();
                        break;

                    case Services.Models.Music:
                        do
                        {
                            try
                            {
                                var musicsBand = SelectInformation.SelectBandByIndex(Menu.BandSelectMenu());
                                ModelCreator.CreateAndSaveMusic(musicsBand.Id);
                                break;
                            }
                            catch (ArgumentOutOfRangeException)
                            {
                                Console.WriteLine("Добвление новой группы:");
                                ModelCreator.CreateAndSaveBand();
                            }
                            catch (IndexOutOfRangeException)
                            {
                                Console.WriteLine("Такая группа уже существует");
                            }
                        } while (true);
                        break;

                    default:
                        Console.WriteLine("Нет такого объекта");
                        break;
                    }
                    break;

                case Actions.View:
                    switch (Menu.WhatShow())
                    {
                    case Services.Models.Band:
                        Menu.ShowAllBands();
                        break;

                    case Services.Models.Music:
                        switch (Menu.MusicShowChoseMenu())
                        {
                        case Constants.SHOW_ALL:
                            Menu.ShowAllMusics();
                            break;

                        case Constants.SHOW_BY_NAME:
                            Band   musicBand = new Band();
                            string musicName = SetInformation.SetMusicName();
                            var    music     = SelectInformation.SelectMusicsByName(musicName, musicBand);
                            Menu.ShowMusics(new List <Music>()
                            {
                                music
                            });
                            break;

                        case Constants.SHOW_BY_BAND:
                            var bands          = SelectInformation.SelectAllBand();
                            var band           = bands[Menu.BandSelectMenu()];
                            var selectedMusics = SelectInformation.SelectMusicsByBandName(band.Name);
                            Menu.ShowMusics(selectedMusics);
                            break;

                        case Constants.SHOW_BY_RATING:
                            switch (Menu.ChoseSortTypeMenu())
                            {
                            case SortType.Ascending:
                                var sortedMusicAscending = SortingService.SortMusicAscendingRating(SelectInformation.SelectAllMusic());
                                Menu.ShowMusics(sortedMusicAscending);
                                break;

                            case SortType.Descending:
                                var sortedMusicDescending = SortingService.SortMusicDescendingRating(SelectInformation.SelectAllMusic());
                                Menu.ShowMusics(sortedMusicDescending);
                                break;

                            default:
                                Console.WriteLine("Нет такого типа сортировки");
                                break;
                            }
                            break;

                        default:
                            Console.WriteLine("Выберите из предложенных вариантов");
                            break;
                        }
                        break;

                    default:
                        Console.WriteLine("Нет такого объекта");
                        break;
                    }
                    break;

                case Actions.Exit:
                    isFinish = true;
                    break;

                default:
                    Console.WriteLine("Нет такого действия");
                    break;
                }
            } while (!isFinish);
        }
 public MainWindow()
 {
     InitializeComponent();
     fileService    = new FileService();
     sortingService = new SortingService();
 }
        public void GenericSortTest()
        {
            var sortingService = new SortingService(new ExpressionBuilder());

            var vm = new SortingModel();
            vm.SortingColumnCurrent = "";
            vm.ShouldReOrder = true;
            vm.SortingColumnNew = "BornDate";
            vm.SortingOrderCurrent = SortingOrder.Ascending;

            var resultSet = sortingService.GenericSortQuery<Person>(Persons.AsQueryable(), vm);
            Assert.IsTrue(resultSet.FirstOrDefault().Name.Equals("kelly"));

            // same column is clicked, order changed
            resultSet = sortingService.GenericSortQuery<Person>(Persons.AsQueryable(), vm);
            Assert.IsTrue(resultSet.FirstOrDefault().Name.Equals("joe"));

            //different column is clicked, ascending as default
            vm.SortingColumnNew = "Name";
            vm.ShouldReOrder = true;
            resultSet = sortingService.GenericSortQuery<Person>(Persons.AsQueryable(), vm);
            Assert.IsTrue(resultSet.FirstOrDefault().Name.Equals("anna"));
        }
Beispiel #29
0
        /// <summary>
        /// Добавление рабочих часов сотруднику, вызов метода происходит из объекта класса Leader
        /// </summary>
        private static void Leader_AddWorkHours()
        {
            Console.WriteLine("Добавление часов сотруднику, для этого необходимо ввести имя и фамилию сотрудника");
            Employee employee = new Employee();

            employee = FindEmployeeInFile();

            List <string>  listHoursWorked = new List <string>();
            SortingService sortSrv         = new SortingService();

            if (employee != null)
            {
                FileIOService file;
                switch (employee.Role)
                {
                case "руководитель":
                    Console.WriteLine("Добавляем отработанные часы руководителю");

                    file = new FileIOService("Список отработанных часов руководителей");
                    file.AddStringToFile(Output.AddHoursWorked(employee));

                    listHoursWorked = file.LoadListOfHoursWorked();

                    if (sortSrv.NeedSorting(listHoursWorked))
                    {
                        listHoursWorked = sortSrv.SortingList(listHoursWorked);
                    }
                    file.OverwriteListOfHoursWorkedToFile(sortSrv.FindDuplicateLines(listHoursWorked));
                    break;

                case "сотрудник":
                    Console.WriteLine("Добавляем отработанные часы сотруднику на зарплате");

                    file = new FileIOService("Список отработанных часов сотрудников на зарплате");
                    file.AddStringToFile(Output.AddHoursWorked(employee));

                    listHoursWorked = file.LoadListOfHoursWorked();

                    if (sortSrv.NeedSorting(listHoursWorked))
                    {
                        listHoursWorked = sortSrv.SortingList(listHoursWorked);
                    }
                    file.OverwriteListOfHoursWorkedToFile(sortSrv.FindDuplicateLines(listHoursWorked));
                    break;

                case "фрилансер":
                    Console.WriteLine("Добавляем отработанные часы фрилансеру");

                    file = new FileIOService("Список отработанных часов внештатных сотрудников");
                    file.AddStringToFile(Output.AddHoursWorked(employee));

                    listHoursWorked = file.LoadListOfHoursWorked();

                    if (sortSrv.NeedSorting(listHoursWorked))
                    {
                        listHoursWorked = sortSrv.SortingList(listHoursWorked);
                    }
                    file.OverwriteListOfHoursWorkedToFile(sortSrv.FindDuplicateLines(listHoursWorked));
                    break;
                }
            }
        }
Beispiel #30
0
 public IEnumerable <Student> Get(string parameter)
 {
     return(SortingService.SortBy(parameter, _uow));
 }
Beispiel #31
0
        public void SortRepositoriesTests(SortingOption sortingOption, bool isReversed)
        {
            //Arrange
            Repository topRepository, bottomRepository;

            List <Repository> repositoryList = new List <Repository>();

            for (int i = 0; i < DemoDataConstants.RepoCount; i++)
            {
                repositoryList.Add(CreateRepository());
            }

            //Act
            var sortedRepositoryList = SortingService.SortRepositories(repositoryList, sortingOption, isReversed);

            topRepository    = sortedRepositoryList.First();
            bottomRepository = sortedRepositoryList.Last();

            //Assert
            switch (sortingOption)
            {
            case SortingOption.Clones when isReversed:
                Assert.Less(topRepository.TotalClones, bottomRepository.TotalClones);
                break;

            case SortingOption.Clones:
                Assert.Greater(topRepository.TotalClones, bottomRepository.TotalClones);
                break;

            case SortingOption.Forks when isReversed:
                Assert.Less(topRepository.ForkCount, bottomRepository.ForkCount);
                break;

            case SortingOption.Forks:
                Assert.Greater(topRepository.ForkCount, bottomRepository.ForkCount);
                break;

            case SortingOption.Issues when isReversed:
                Assert.Less(topRepository.IssuesCount, bottomRepository.IssuesCount);
                break;

            case SortingOption.Issues:
                Assert.Greater(topRepository.IssuesCount, bottomRepository.IssuesCount);
                break;

            case SortingOption.Stars when isReversed:
                Assert.Less(topRepository.StarCount, bottomRepository.StarCount);
                break;

            case SortingOption.Stars:
                Assert.Greater(topRepository.StarCount, bottomRepository.StarCount);
                break;

            case SortingOption.UniqueClones when isReversed:
                Assert.Less(topRepository.TotalUniqueClones, bottomRepository.TotalUniqueClones);
                break;

            case SortingOption.UniqueClones:
                Assert.Greater(topRepository.TotalUniqueClones, bottomRepository.TotalUniqueClones);
                break;

            case SortingOption.UniqueViews when isReversed:
                Assert.Less(topRepository.TotalUniqueViews, bottomRepository.TotalUniqueViews);
                break;

            case SortingOption.UniqueViews:
                Assert.Greater(topRepository.TotalUniqueViews, bottomRepository.TotalUniqueViews);
                break;

            case SortingOption.Views when isReversed:
                Assert.Less(topRepository.TotalViews, bottomRepository.TotalViews);
                break;

            case SortingOption.Views:
                Assert.Greater(topRepository.TotalViews, bottomRepository.TotalViews);
                break;

            default:
                throw new NotSupportedException();
            }
        }