public void Extractor_RangeIsInvalid_ThrowsArgumentOutOfRangeException(int start, int end)
        {
            var       extractor  = new TaskExtractor(OutputService.GetInstance(), InputService.GetInstance());
            const int ARRAY_SIZE = 40;

            Assert.Throws <ArgumentOutOfRangeException>(() => extractor.GetRandomDoubleEnumerable(count: ARRAY_SIZE, startRange: start, endRange: end));
        }
示例#2
0
        public void GetNumber_ConsoleInputIsInvalid_ReturnsFalse(string str)
        {
            Console.SetIn(new StringReader(str));
            var  extractor    = Substitute.For <TaskExtractor>(OutputService.GetInstance(), InputService.GetInstance());
            bool actualResult = extractor.GetNumber(out _, string.Empty);

            Assert.IsFalse(actualResult);
        }
示例#3
0
        public int GetNumber_ConsoleInputIsValid_ReturnsResult(string str)
        {
            Console.SetIn(new StringReader(str));
            var  extractor    = Substitute.For <TaskExtractor>(OutputService.GetInstance(), InputService.GetInstance());
            bool actualResult = extractor.GetNumber(out var result, string.Empty);

            Assert.IsTrue(actualResult);
            return(result);
        }
示例#4
0
        public string Run()
        {
            var extract = new ExtractForTasks(InputService.GetInstance(), OutputService.GetInstance());

            uint[] arrValue = extract.IndividualB5();
            uint   year     = arrValue[0],
                   mounth   = arrValue[1];

            return(IndividualTaskB5(mounth, year));
        }
示例#5
0
        public string Run()
        {
            var extract = new ExtractForTasks(InputService.GetInstance(), OutputService.GetInstance());

            int[] arrValue = extract.Additional1();
            int   day      = arrValue[0],
                  mounth   = arrValue[1],
                  year     = arrValue[2];

            return(AdditionalTask1(day, mounth, year));
        }
示例#6
0
        public string Run()
        {
            var extract = new ExtractForTasks(InputService.GetInstance(), OutputService.GetInstance());

            return(IndividualTaskB6(extract.IndividualB6()));
        }
示例#7
0
        public string Run()
        {
            ExtractForTasks extract = new ExtractForTasks(InputService.GetInstance(), OutputService.GetInstance());

            int[] arrValue       = extract.IndividualB3();
            int   indexAdvantage = arrValue[0],
                  indexSuits     = arrValue[1];

            return(IndividualTaskB3(indexAdvantage, indexSuits));
        }
示例#8
0
        public string Run()
        {
            ExtractForTasks extract = new ExtractForTasks(InputService.GetInstance(), OutputService.GetInstance());

            double[] arrValue = extract.IndividualA1();
            double   aSide    = arrValue[0];
            double   bSide    = arrValue[1];
            double   cSide    = arrValue[2];

            return(IndividualTaskA1(aSide, bSide, cSide));
        }
示例#9
0
        public string Run()
        {
            ExtractForTasks extract = new ExtractForTasks(InputService.GetInstance(), OutputService.GetInstance());

            int[] arrValue     = extract.IndividualA4();
            int   firstNumber  = arrValue[0];
            int   secondNumber = arrValue[1];

            return(IndividualTaskA4(firstNumber, secondNumber));
        }
示例#10
0
        public string Run()
        {
            ExtractForTasks extract = new ExtractForTasks(InputService.GetInstance(), OutputService.GetInstance());

            return(CommonTask3(extract.Common3()));
        }
        public void Extractor_CountIsInvalid_ThrowsArgumentException(int count)
        {
            var extractor = new TaskExtractor(OutputService.GetInstance(), InputService.GetInstance());

            Assert.Throws <ArgumentException>(() => extractor.GetRandomDoubleEnumerable(count));
        }
示例#12
0
        public string Run()
        {
            ExtractForTasks extract = new ExtractForTasks(InputService.GetInstance(), OutputService.GetInstance());

            int[] arrValue = extract.IndividualB8();
            int   day      = arrValue[0],
                  mounth   = arrValue[1];

            return(IndividualTaskB8(day, mounth));
        }