public void guard_against_invalid_lease_renewal_times(int seconds)
        {
            var leaseUpdate = TimeSpan.FromSeconds(seconds);

            var builder = new LeaseConfigurationBuilder(NodeId);

            Assert.Throws <ArgumentOutOfRangeException>(() => builder.RenewLeaseEvery(leaseUpdate));
        }
        public void prevent_a_lease_from_being_aquired_more_frequently_than_it_is_renewed(int aquireEveryDays)
        {
            var builder = new LeaseConfigurationBuilder(NodeId);

            builder.RenewLeaseEvery(TimeSpan.FromDays(2));
            builder.AquireLeaseEvery(TimeSpan.FromDays(aquireEveryDays));

            Assert.Throws <HostConfigurationException>(() => builder.Build());
        }
        public void use_the_lease_renewal_time_that_is_provided()
        {
            var leaseUpdate = TimeSpan.FromDays(1);

            var builder = new LeaseConfigurationBuilder(NodeId);

            builder.RenewLeaseEvery(leaseUpdate);
            builder.AquireLeaseEvery(TimeSpan.FromDays(2));

            Assert.Equal(leaseUpdate, builder.Build().LeaseCriteria.RenewLeaseEvery);
        }