Beispiel #1
0
        public ISorter GetSorter(SorterTypeEnum type)
        {
            switch (type)
            {
            case SorterTypeEnum.InsertionSort:
                return(new InsertionSorter());

            case SorterTypeEnum.QuickSort:
                return(new QuickSorter());

            default:
                throw new NotImplementedException($"Unsupported SorterType: {type}.");
            }
        }
Beispiel #2
0
        public void GetSorter_Should_Return_Correct_Type(SorterTypeEnum type, Type sorterType)
        {
            var sorter = _factory.GetSorter(type);

            sorter.Should().BeOfType(sorterType);
        }