示例#1
0
        public void UpdateCorso()
        {
            var corsoController = new CorsoApiController(mockRepositoryCorsi.Object);
            var result          = corsoController.UpdateCorso(new Corso());

            result.Should().BeOfType <OkObjectResult>();
        }
示例#2
0
        public void CorsoPerID()
        {
            var corsoController = new CorsoApiController(mockRepositoryCorsi.Object);
            var result          = corsoController.CorsoPerID("3");

            result.Should().BeOfType <OkObjectResult>();
            ((OkObjectResult)result).Value.Should().BeOfType <Corso>();
        }
示例#3
0
        public void ListaCorsi()
        {
            var         corsoController = new CorsoApiController(mockRepositoryCorsi.Object);
            var         result          = corsoController.ListaCorsi("test");
            IEnumerable list            = (IEnumerable)((OkObjectResult)result).Value;

            foreach (CorsoModels c in list)
            {
                output.WriteLine(c.ToString());
            }

            result.Should().BeOfType <OkObjectResult>();
        }