public void Insert_AlreadyExistsInContext_False() { // Arrange var logic = new PatientLogic(new PatientRepo(new MemoryPatientContext())); var patient = GenerateValidPatient(); // Act logic.Insert(patient); var isAccepted = logic.Insert(patient); // Assert Assert.False(isAccepted); }
public void Insert_ValidPatient_True() { // Arrange var logic = new PatientLogic(new PatientRepo(new MemoryPatientContext())); var patient = GenerateValidPatient(); // Act var isAccepted = logic.Insert(patient); // Assert Assert.True(isAccepted); }
public void Update_ValidPatient_True() { // Arrange var logic = new PatientLogic(new PatientRepo(new MemoryPatientContext())); var existingPatient = GenerateValidPatient(); var patient = existingPatient; // Act logic.Insert(existingPatient); var isAccepted = logic.Update(patient); // Assert Assert.True(isAccepted); }
public void Insert_NameWhitespace_False() { // Arrange var logic = new PatientLogic(new PatientRepo(new MemoryPatientContext())); var patient = new Patient { Name = " ", Age = 18, IsApproved = false }; // Act var isAccepted = logic.Insert(patient); // Assert Assert.False(isAccepted); }
public void Insert_NegativeAge_False() { // Arrange var logic = new PatientLogic(new PatientRepo(new MemoryPatientContext())); var patient = new Patient() { Name = "Mark", Age = -6, IsApproved = false }; // Act var isAccepted = logic.Insert(patient); // Assert Assert.False(isAccepted); }
public void Update_NameWhitespace_False() { // Arrange var logic = new PatientLogic(new PatientRepo(new MemoryPatientContext())); var existingPatient = GenerateValidPatient(); var patient = new Patient { Name = " ", Age = 18, IsApproved = false }; // Act logic.Insert(existingPatient); var isAccepted = logic.Update(patient); // Assert Assert.False(isAccepted); }