public void GetbyId() { InitializeDataBase(); // Use a clean instance of the context to run the test using (var context = new AtividadeContext(options)) { int ativiId = 2; ResponsavelController responsavelController = new ResponsavelController(context); Responsavel responsavel = responsavelController.GetResponsavel(ativiId).Result.Value; Assert.Equal(2, responsavel.Id); } }
public void GetAll() { InitializeDataBase(); // Use a clean instance of the context to run the test using (var context = new AtividadeContext(options)) { ResponsavelController responsavelController = new ResponsavelController(context); IEnumerable <Responsavel> responsavels = responsavelController.GetResponsavel().Result.Value; Assert.Equal(3, responsavels.Count()); } }