public void TestMinGreaterThanMaxException() { var randomOrg = new RandomOrgV1(); Assert.ThrowsException <RandoOrgMinGreaterThanMaxException>(() => randomOrg.IntegerRequest(6, 1)); Assert.ThrowsException <RandoOrgMinGreaterThanMaxException>(() => randomOrg.IntegerRequest(-60, -100)); }
public async Task <string> CallRequestAsync() { var randomOrg = new RandomOrgV1(); var result = await randomOrg.IntegerRequest(1, 100).Request(); return(result); }
private async void appBarButton_Click(object sender, EventArgs e) { try { RandomOrgV1 randomOrg = new RandomOrgV1(); txtResult.Text = await randomOrg.IntegerRequest(Int32.Parse(txtMin.Text), Int32.Parse(txtMax.Text)).Request(); } catch (RandoOrgMinGreaterThanMaxException exception) { txtResult.Text = exception.Message; } catch (Exception exception) { txtResult.Text = exception.Message; } }
public void TestFluentIntegersAddress() { var randomOrg = new RandomOrgV1(); Assert.AreEqual("http://random.org/integers?num=1&min=1&max=100&col=1&base=10&format=plain&rnd=new", randomOrg.IntegerRequest(1, 100).RequestAddress.AbsoluteUri); }