Exemple #1
0
        public void Lease_this_instance_for_webdeploy()
        {
            _service.Start();
            Thread.Sleep(TimeSpan.FromSeconds(4));

            var hasWebDeployLease = AzureRoleEnvironment.HasWebDeployLease();

            Assert.That(hasWebDeployLease, Is.True);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.StatusCode = AzureRoleEnvironment.HasWebDeployLease()
         ? (int)HttpStatusCode.OK
         : (int)HttpStatusCode.ServiceUnavailable;
 }
Exemple #4
0
 public void Not_have_a_webdeploy_lease_initially()
 {
     Assert.That(AzureRoleEnvironment.HasWebDeployLease(), Is.False);
 }