public void Create() { InitializeDataBase(); Curso curso = new Curso() { Id = 4, Descricao = "Curso SQL Server", DataInicio = DateTime.ParseExact("05/18/2021", "d", CultureInfo.InvariantCulture), DataTermino = DateTime.ParseExact("06/18/2021", "d", CultureInfo.InvariantCulture), QtdAlunos = 40 }; using (var context = new ApplicationContext(options)) { CursoController cursoController = new CursoController(context); Curso c = cursoController.PostCurso(curso).Result.Value; Assert.Equal(4, c.Id); } }