public void CanTakeWhenUsingDuplicateIds() { var lookup = new ConcurrentLookup <ContextElement>(); lookup.Add(new ContextElement("Type", "Subject", null)); lookup.Add(new ContextElement("Type", "SubjectS", null)); Assert.NotNull(lookup.Take("Type")); Assert.NotNull(lookup.Take("Type")); }
public void ReturnsNullWhenAllTaken() { var lookup = new ConcurrentLookup <ContextElement>(); lookup.Add(new ContextElement("Type", "Subject", null)); lookup.Add(new ContextElement("Type", "SubjectS", null)); Assert.NotNull(lookup.Take("Type")); Assert.NotNull(lookup.Take("Type")); Assert.Null(lookup.Take("Type")); }