Ejemplo n.º 1
0
        public string GetResult(int number)
        {
            if (!IsValid(number))
            {
                throw new ArgumentOutOfRangeException("Number must be greater than 0");
            }

            string result = "";

            foreach (var rule in _ruleRepository.GetAll())
            {
                var resolver = _ruleTypeFactory.Create(rule.RuleType);
                result += resolver.GetWord(number, rule);
            }

            return(string.IsNullOrEmpty(result) ? number.ToString() : result);
        }
Ejemplo n.º 2
0
 public IHttpActionResult GetAll()
 {
     return(Ok(_repository.GetAll()));
 }