コード例 #1
0
        public void Insert_WrongString_EnmptyAlgorithmContainerExpected()
        {
            //arrange
            ILuckyTicketCounterAlgorithm[] current;
            ILuckyTicketCounterAlgorithm[] expected = new ILuckyTicketCounterAlgorithm[] { };
            string algorithmName = "algorithm";

            //Act
            current = validator.GetAlgorythmType(algorithmName);

            //Assert
            CollectionAssert.AreEqual(expected, current);
        }
コード例 #2
0
        private ILuckyTicketCounterAlgorithm[] GetAlgorithmsFromFile()
        {
            string                 path;
            PathValidator          _pathValidator = new PathValidator();
            AlgorythmTypeValidator _typeValidator = new AlgorythmTypeValidator();

            do
            {
                path = _viewer.GetUserAnswerOnQuestion(GET_FILE_PATH + GET_FILE_PATH_PART_TWO);

                if (string.IsNullOrWhiteSpace(path))
                {
                    throw new ArgumentNullException();
                }
            } while (!_pathValidator.IsFilePathValid(path));

            return(_typeValidator.GetAlgorythmType(_pathValidator.GetFileString(path)));
        }