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>())); }
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(); }
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(); }
public void InsertPatient(Core.DAO.Patient patient) { new Core.Patient().InsertPatient(patient); }