public async void NoLeases_Expect_NextLeaseToBeStartIpAddress() { var config = DhcpFakes.FakeDhcpConfiguration(); var leaseRepo = new LeaseRepo(DbConfig); var leaseManager = new LeaseManager(config, leaseRepo); var nextLease = await leaseManager.GetNextLease().ConfigureAwait(false); Assert.Equal(config.StartIpAddress, nextLease); }
public async void InsertLease_Expect_NextLeaseToBeNextIpAddress() { var config = DhcpFakes.FakeDhcpConfiguration(); var nextIp = config.StartIpAddress.ToNextIpAddress(); var leaseRepo = new LeaseRepo(DbConfig); var leaseManager = new LeaseManager(DhcpFakes.FakeDhcpConfiguration(), leaseRepo); var lease = ModelFakes.GetFakeLease(config.StartIpAddress.ToString()); await leaseRepo.Insert(lease).ConfigureAwait(false); var nextLease = await leaseManager.GetNextLease(); Assert.Equal(nextIp, nextLease); }