public void UpdateSleep_AllPropertiesValid_DoesNotThrowArgumentException() { //Arrange Mock<AccessTokenManagerBaseStub> tokenManager = new Mock<AccessTokenManagerBaseStub>(); SleepEndpoint sleepRequest = new SleepEndpoint(tokenManager.Object, new UsersModel()); //Act and Assert Assert.DoesNotThrow(() => { sleepRequest.UpdateSleep(ValidSleep); }); }
public void UpdateSleep_AllMeasurementsNull_ArgumentException() { //Arrange Mock<AccessTokenManagerBaseStub> tokenManager = new Mock<AccessTokenManagerBaseStub>(); SleepEndpoint sleepRequest = new SleepEndpoint(tokenManager.Object, new UsersModel()); //Act ValidSleep.Awake = null; ValidSleep.Deep = null; ValidSleep.Light = null; ValidSleep.Rem = null; ValidSleep.TimesWoken = null; ValidSleep.TotalSleep = null; //Assert Assert.Throws(typeof(ArgumentException), () => { sleepRequest.UpdateSleep(ValidSleep); }); }