public void UpdateValidData_Return_OkResult() { //arrange ClinicalDataAccessLayer testClinicalAccess = new ClinicalDataAccessLayer(); var postId = 1; int expected = 1; //1 = successfully added to DB //act Clinical existingPost = testClinicalAccess.GetClinicalData(postId); existingPost.Name = "Test Name Updated"; int returnVal = testClinicalAccess.UpdateClinical(existingPost); //assert Assert.Equal(expected, returnVal); }
public void UpdateInvalidData_Return_NotFound() { //arrange ClinicalDataAccessLayer testClinicalAccess = new ClinicalDataAccessLayer(); var postId = 1; int expected = 0; // 0 = not added successfully to DB //act Clinical existingPost = testClinicalAccess.GetClinicalData(postId); var invalidPost = new Clinical(); invalidPost = existingPost; invalidPost.Name = null; invalidPost.WhatIs = null; int returnVal = testClinicalAccess.UpdateClinical(invalidPost); //assert Assert.Equal(expected, returnVal); }
public int Edit([FromBody] Clinical clinical) { return(objclinical.UpdateClinical(clinical)); }