public void UpdateCorso() { var corsoController = new CorsoApiController(mockRepositoryCorsi.Object); var result = corsoController.UpdateCorso(new Corso()); result.Should().BeOfType <OkObjectResult>(); }
public void CorsoPerID() { var corsoController = new CorsoApiController(mockRepositoryCorsi.Object); var result = corsoController.CorsoPerID("3"); result.Should().BeOfType <OkObjectResult>(); ((OkObjectResult)result).Value.Should().BeOfType <Corso>(); }
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>(); }