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)); }
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); }
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); }
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)); }
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)); }
public string Run() { var extract = new ExtractForTasks(InputService.GetInstance(), OutputService.GetInstance()); return(IndividualTaskB6(extract.IndividualB6())); }
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)); }
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)); }
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)); }
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)); }
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)); }