예제 #1
0
        public async Task ProcessOutputAsync(IFizzBuzzOutput output)
        {
            var json = JsonConvert.SerializeObject(output, Formatting.Indented);

            _httpContextAccessor.HttpContext.Response.ContentType = "application/json";
            await _httpContextAccessor.HttpContext.Response.WriteAsync(json, Encoding.UTF8);
        }
예제 #2
0
 public async Task ProcessOutputAsync(IFizzBuzzOutput output)
 {
     foreach (var value in output)
     {
         await ProcessOutputValueAsync(value.Input, value.Flags);
     }
 }
        public FizzBuzzProcessor(int start, int end, FizzBuzz fizzBuzz, IFizzBuzzOutput output)
        {
            if (end < start)
            {
                throw new ArgumentOutOfRangeException(nameof(end));
            }
            _fizzBuzz = fizzBuzz ?? throw new ArgumentNullException(nameof(fizzBuzz));
            _output   = output ?? throw new ArgumentNullException(nameof(output));

            _start = start;
            _end   = end;
        }
        public FizzBuzzProcessor(int start, int end, FizzBuzz fizzBuzz, IFizzBuzzOutput output)
        {
            if (end < start)
                throw new ArgumentOutOfRangeException("end");
            if (fizzBuzz == null)
                throw new ArgumentNullException("fizzBuzz");
            if (output == null)
                throw new ArgumentNullException("output");

            _start = start;
            _end = end;
            _fizzBuzz = fizzBuzz;
            _output = output;
        }
예제 #5
0
        public FizzBuzzProcessor(int start, int end, FizzBuzz fizzBuzz, IFizzBuzzOutput output)
        {
            if (end < start)
            {
                throw new ArgumentOutOfRangeException("end");
            }
            if (fizzBuzz == null)
            {
                throw new ArgumentNullException("fizzBuzz");
            }
            if (output == null)
            {
                throw new ArgumentNullException("output");
            }

            _start    = start;
            _end      = end;
            _fizzBuzz = fizzBuzz;
            _output   = output;
        }