public void Lease_this_instance_for_webdeploy() { _service.Start(); Thread.Sleep(TimeSpan.FromSeconds(4)); var hasWebDeployLease = AzureRoleEnvironment.HasWebDeployLease(); Assert.That(hasWebDeployLease, Is.True); }
public void Release_lease_when_requested() { _service.Start(); Thread.Sleep(TimeSpan.FromSeconds(4)); _service.Dispose(); Thread.Sleep(TimeSpan.FromSeconds(2)); var hasWebDeployLease = AzureRoleEnvironment.HasWebDeployLease(); Assert.That(hasWebDeployLease, Is.False); Assert.That(AzureRoleEnvironment.WebDeployLeaseBlob().Metadata["InstanceId"], Is.Null); }
protected void Page_Load(object sender, EventArgs e) { Response.StatusCode = AzureRoleEnvironment.HasWebDeployLease() ? (int)HttpStatusCode.OK : (int)HttpStatusCode.ServiceUnavailable; }
public void Not_have_a_webdeploy_lease_initially() { Assert.That(AzureRoleEnvironment.HasWebDeployLease(), Is.False); }