Ejemplo n.º 1
0
        public void InsertPatientSuccessfully()
        {
            var patient = new Core.DAO.Patient
            {
                FirstName     = "Test1",
                LastName      = "Test2",
                Age           = 19,
                DOB           = "12/13/2008",
                Gender        = "M",
                Communication = new Core.DAO.Communication
                {
                    Address = "1056 NW 34 St",
                    Country = "USA",
                    Zip     = "33321",
                    Phone   = "3056783432",
                    Email   = "*****@*****.**"
                },
                Description = new Core.DAO.Description
                {
                    Interest       = "",
                    Charateristics = ""
                },
                Image = new Core.DAO.Image
                {
                    ImageCodeBase64 = "fw+YcMuJih0o5nnkDGaZhg=="
                }
            };

            new Core.Patient(mock.Object).InsertPatient(patient);

            mock.Verify(p => p.InsertPatient(It.IsAny <Data.DAO.Patient>()));
        }
Ejemplo n.º 2
0
        public void DOBIncorrect()
        {
            var patient = new Core.DAO.Patient
            {
                FirstName     = "Test1",
                LastName      = "Test2",
                Age           = 20,
                DOB           = "12/13/2",
                Gender        = "M",
                Communication = new Core.DAO.Communication
                {
                    Address = "1056 NW 34 St",
                    Country = "USA",
                    Zip     = "33321",
                    Phone   = "3056783432",
                    Email   = "*****@*****.**"
                },
                Description = new Core.DAO.Description
                {
                    Interest       = "",
                    Charateristics = ""
                },
                Image = new Core.DAO.Image
                {
                    ImageCodeBase64 = "fw+YcMuJih0o5nnkDGaZhg=="
                }
            };
            var ex = Assert.ThrowsException <Core.Exceptions.ValidationException>(() => new Core.Patient(mock.Object).InsertPatient(patient));

            Assert.IsTrue(ex.Message.Contains("Date Of Birth is incorrectly formatted."));

            mock.VerifyNoOtherCalls();
        }
Ejemplo n.º 3
0
        public void AddressIsNotFilledOut()
        {
            var patient = new Core.DAO.Patient
            {
                FirstName     = "Test1",
                LastName      = "Test2",
                Age           = 19,
                DOB           = "12/13/2008",
                Gender        = "M",
                Communication = new Core.DAO.Communication
                {
                    Address = "1056 NW 34 St",
                    Country = "",
                    Zip     = "33321",
                    Phone   = "3056783432",
                    Email   = "*****@*****.**"
                },
                Description = new Core.DAO.Description
                {
                    Interest       = "",
                    Charateristics = ""
                },
                Image = new Core.DAO.Image
                {
                    ImageCodeBase64 = "fw+YcMuJih0o5nnkDGaZhg=="
                }
            };
            var ex = Assert.ThrowsException <Core.Exceptions.ValidationException>(() => new Core.Patient(mock.Object).InsertPatient(patient));

            Assert.IsTrue(ex.Message.Contains("A complete address must be filled out."));

            mock.VerifyNoOtherCalls();
        }
Ejemplo n.º 4
0
 public void InsertPatient(Core.DAO.Patient patient)
 {
     new Core.Patient().InsertPatient(patient);
 }