Exemple #1
0
        public void AgregarPaciente()
        {
            // Arrange
            var controller = new PacientesController();

            Pacientes paciente = new Pacientes()
            {
                Id        = 501870174,
                Nombre    = "Sonia",
                Apellido1 = "Castrillo",
                Apellido2 = "Baltodano"
            };

            // Act
            IHttpActionResult actionResult = controller.PostPacientes(paciente);
            var createdResult = actionResult as CreatedAtRouteNegotiatedContentResult <Pacientes>;

            // Assert
            Assert.IsNotNull(createdResult);
            Assert.AreEqual("DefaultApi", createdResult.RouteName);
            Assert.IsNotNull(createdResult.RouteValues["id"]);
        }