public void GivenAProfessorService_WhenCallingAddProfessor_ThenRecieveTheAddedProfessor()
        {
            //Given
            var professorService = new ProfessorService();
            //When
            var actual = professorService.CreateProfessor("hello", "world");

            //Then
            Assert.Equal("world", actual.LastName);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Post([FromBody] Professor professor)
        {
            var result = await _service.CreateProfessor(professor);

            if (result.Item1)
            {
                return(Ok(result.Item2));
            }
            return(BadRequest(result.Item2));
        }