Beispiel #1
0
        public void GenerarDiagnosticoCuandoExistenDetalles()
        {
            var context = ApplicationDbContextInMemory.Get();

            var eventHandler = new DiagnosticoCreateEventHandler(context, GetLogger);

            string expectedResult = "rubeola";

            var diagnostico = new DiagnosticoCreateCommand
            {
                DetallesDiagnostico = new List <DetalleDiagnosticoCreate>
                {
                    new DetalleDiagnosticoCreate
                    {
                        Sintoma = "fiebre",
                    },
                    new DetalleDiagnosticoCreate
                    {
                        Sintoma = "escalofrios",
                    },
                    new DetalleDiagnosticoCreate
                    {
                        Sintoma = "dolorcabeza",
                    },
                    new DetalleDiagnosticoCreate
                    {
                        Sintoma = "ojosrojos",
                    }
                }
            };

            string actualResult = eventHandler.DeterminarEnfermedad(diagnostico);

            Assert.AreEqual(expectedResult, actualResult);
        }
Beispiel #2
0
        public void GenerarDiagnosticoCuandoNoExistenDetalles()
        {
            var context = ApplicationDbContextInMemory.Get();

            var eventHandler = new DiagnosticoCreateEventHandler(context, GetLogger);

            var diagnostico = new DiagnosticoCreateCommand
            {
                DetallesDiagnostico = new List <DetalleDiagnosticoCreate>()
            };

            eventHandler.DeterminarEnfermedad(diagnostico);
        }