コード例 #1
0
        public void Post_processar()
        {
            var list     = _equipeRepository.GetList(new EquipeSeletor()).Take(8);
            var result   = _copaService.ProcessarCopa(list);
            var resultOk = new List <string>()
            {
                "Equipe 2", "Equipe 13"
            };

            Assert.Equal(result.Select(x => x.Nome), resultOk);
        }
コード例 #2
0
        public ActionResult Processar([FromBody] IEnumerable <EquipeDomain> equipes)
        {
            try
            {
                var result = _service.ProcessarCopa(equipes);

                return(Ok(new ResponseViewModel
                {
                    Data = result,
                    Count = result.Count()
                }));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }