private void SimulateDeAllocationIfRequired(AllocatableSalesPerson salesPerson) { if (!_behaviourConfiguration.DeAllocationTimeSec.HasValue) { return; } Task.Delay(_behaviourConfiguration.DeAllocationTimeSec.Value * SECOND_TO_MILLISECOND) .ContinueWith(t => salesPerson.Deallocate()); }
private static bool Any(AllocatableSalesPerson s) => true;
protected void ASalePersonHasBeenAllocated(AllocatableSalesPerson salesPerson) => _testModule.SalesPersonStore.FindMatchingSalesPerson( s => s.Equals(salesPerson)).Single().AllocateToCustomer();
protected void SalesPersonIsAvailable(AllocatableSalesPerson salesPerson) => _testModule.SalesPersonStore.RegisterNewSalesPerson(salesPerson);
public static SalesPersonDto FromDomainEntity( AllocatableSalesPerson domainSalesPerson) => new SalesPersonDto( domainSalesPerson.Name, domainSalesPerson.IsAllocated);
private bool SalesPersonMatchingCriteria(AllocatableSalesPerson salesPerson) => _salesPersonCriteria.Matches(salesPerson);