protected CallSplit GetCallSplit(IList<ICallCopyEntity> callCopyEntities, string huntgroupId) { huntgroupId = huntgroupId ?? string.Empty; CallSplit callSplit = callCopyEntities.OfType<CallSplit>() .FirstOrDefault(x => huntgroupId.Trim().Equals(x.Number)); if (callSplit == null) { Device device = GetDevice(callCopyEntities); callSplit = new CallSplit { Device = device, Number = huntgroupId.Trim()}; callCopyEntities.Add(callSplit); } return callSplit; }
public void RetrievesCallSplitFromLookupContextWithHuntgroupId() { string huntgroupId = "huntgroup"; var expectedCallSplit = new CallSplit {Number = huntgroupId}; _callCopyEntities.Add(expectedCallSplit); _groupStatusBuckets.Add(GroupStatusBucket(new DateTime(1970, 1, 1, 0, 0, 0), huntgroupId: huntgroupId)); ACDSplitDatum acdAgentSplitDatum = _translator.Translate(_groupStatusBuckets, _callCopyEntities).First(); Assert.That(acdAgentSplitDatum.CallSplit, Is.SameAs(expectedCallSplit)); }