public void CreateMeasurement_AllMeasurementsNull_ArgumentException() { //Arrange Mock <AccessTokenManagerBaseStub> tokenManager = new Mock <AccessTokenManagerBaseStub>(); GeneralMeasurementsEndpoint measurementRequest = new GeneralMeasurementsEndpoint(tokenManager.Object, new UsersModel()); //Act ValidMeasurementNew.BloodCalcium = null; ValidMeasurementNew.BloodChromium = null; ValidMeasurementNew.BloodFolicAcid = null; ValidMeasurementNew.BloodMagnesium = null; ValidMeasurementNew.BloodPotassium = null; ValidMeasurementNew.BloodSodium = null; ValidMeasurementNew.BloodVitaminB12 = null; ValidMeasurementNew.BloodZinc = null; ValidMeasurementNew.CreatineKinase = null; ValidMeasurementNew.Crp = null; ValidMeasurementNew.Diastolic = null; ValidMeasurementNew.Ferritin = null; ValidMeasurementNew.Hdl = null; ValidMeasurementNew.Hscrp = null; ValidMeasurementNew.Il6 = null; ValidMeasurementNew.Ldl = null; ValidMeasurementNew.RestingHeartrate = null; ValidMeasurementNew.Systolic = null; ValidMeasurementNew.Testosterone = null; ValidMeasurementNew.TotalCholesterol = null; ValidMeasurementNew.Tsh = null; ValidMeasurementNew.UricAcid = null; ValidMeasurementNew.VitaminD = null; ValidMeasurementNew.WhiteCellCount = null; //Assert Assert.Throws(typeof(ArgumentException), () => { measurementRequest.CreateMeasurement(ValidMeasurementNew); }); }
public void CreateMeasurement_AllPropertiesValid_DoesNotThrowArgumentException() { //Arrange Mock <AccessTokenManagerBaseStub> tokenManager = new Mock <AccessTokenManagerBaseStub>(); GeneralMeasurementsEndpoint measurementRequest = new GeneralMeasurementsEndpoint(tokenManager.Object, new UsersModel()); //Act and Assert Assert.DoesNotThrow(() => { measurementRequest.CreateMeasurement(ValidMeasurementNew); }); }
public void GetMeasurementAsync_UriNotValid_ArgumentException() { //Arrange var validPath = "/test/"; Mock <AccessTokenManagerBaseStub> tokenManager = new Mock <AccessTokenManagerBaseStub>(); GeneralMeasurementsEndpoint measurementRequest = new GeneralMeasurementsEndpoint(tokenManager.Object, new UsersModel { GeneralMeasurements = validPath }); //Act and Assert Assert.Throws(typeof(ArgumentException), () => { measurementRequest.GetMeasurementAsync((m) => { }, (ex) => { }, "Not validPath."); }); }
public void GetMeasurement_UriValid_DoesNotThrowArgumentException() { //Arrange var validPath = "/test/"; Mock <AccessTokenManagerBaseStub> tokenManager = new Mock <AccessTokenManagerBaseStub>(); GeneralMeasurementsEndpoint measurementRequest = new GeneralMeasurementsEndpoint(tokenManager.Object, new UsersModel { GeneralMeasurements = validPath }); //Act and Assert Assert.DoesNotThrow(() => { measurementRequest.GetMeasurement(validPath); }); }