public void CreateSleep_AllPropertiesValid_DoesNotThrowArgumentException() { //Arrange Mock<AccessTokenManagerBaseStub> tokenManager = new Mock<AccessTokenManagerBaseStub>(); SleepEndpoint sleepRequest = new SleepEndpoint(tokenManager.Object, new UsersModel()); //Act and Assert Assert.DoesNotThrow(() => { sleepRequest.CreateSleep(ValidSleepNew); }); }
public void DeleteSleepAsync_UriValid_DoesNotThrowArgumentException() { //Arrange var validPath = "/test/"; Mock<AccessTokenManagerBaseStub> tokenManager = new Mock<AccessTokenManagerBaseStub>(); SleepEndpoint sleepRequest = new SleepEndpoint(tokenManager.Object, new UsersModel { Sleep = validPath }); //Act and Assert Assert.DoesNotThrow(() => { sleepRequest.DeleteSleepAsync(() => { }, (ex) => { }, validPath); }); }
public void CreateSleep_AllMeasurementsNull_ArgumentException() { //Arrange Mock<AccessTokenManagerBaseStub> tokenManager = new Mock<AccessTokenManagerBaseStub>(); SleepEndpoint sleepRequest = new SleepEndpoint(tokenManager.Object, new UsersModel()); //Act ValidSleepNew.Awake = null; ValidSleepNew.Deep = null; ValidSleepNew.Light = null; ValidSleepNew.Rem = null; ValidSleepNew.TimesWoken = null; ValidSleepNew.TotalSleep = null; //Assert Assert.Throws(typeof(ArgumentException), () => { sleepRequest.CreateSleep(ValidSleepNew); }); }
public void DeleteSleep_UriNotValid_ArgumentException() { //Arrange var validPath = "/test/"; Mock<AccessTokenManagerBaseStub> tokenManager = new Mock<AccessTokenManagerBaseStub>(); SleepEndpoint sleepRequest = new SleepEndpoint(tokenManager.Object, new UsersModel { Sleep = validPath }); //Act and Assert Assert.Throws(typeof(ArgumentException), () => { sleepRequest.DeleteSleep("Not validPath."); }); }