Ejemplo n.º 1
0
        public bool Remove(T item)
        {
            bool res;

            _Letter = _Letter.Remove(item, out res);
            return(res);
        }
Ejemplo n.º 2
0
        public bool Add(T item)
        {
            bool res;

            _Letter = _Letter.Add(item, out res);
            return(res);
        }
Ejemplo n.º 3
0
        public void SymmetricExceptWith(IEnumerable <T> other)
        {
            var otherHashSet = new HashSet <T>(other);
            var first        = _Letter.Where(n => !otherHashSet.Contains(n));
            var second       = otherHashSet.Where(n => !_Letter.Contains(n));

            _Letter = LetterSimpleSetFactoryBuilder.Factory.GetDefault(first.Concat(second));
        }
Ejemplo n.º 4
0
        public HybridSetTest()
        {
            _Enumerable = Substitute.For <IEnumerable <string> >();
            _LetterSimpleSetSubstitute = Substitute.For <ILetterSimpleSet <string> >();
            _LetterSimpleSetFactory    = Substitute.For <ILetterSimpleSetFactory>();
            _LetterSimpleSetFactory.GetDefault <string>().Returns(_LetterSimpleSetSubstitute);
            _LetterSimpleSetFactory.GetDefault <string>(Arg.Any <string>()).Returns(_LetterSimpleSetSubstitute);
            _LetterSimpleSetFactory.GetDefault <string>(Arg.Any <IEnumerable <string> >()).Returns(arg =>
            {
                _GetDefaultParameter = ((IEnumerable <string>)arg[0]).ToList();
                return(_LetterSimpleSetSubstitute);
            });

            bool res;

            _LetterSimpleSetSubstitute.Add(Arg.Any <string>(), out res).Returns(_LetterSimpleSetSubstitute);

            _Factory = LetterSimpleSetFactoryBuilder.Factory;
            LetterSimpleSetFactoryBuilder.Factory = _LetterSimpleSetFactory;
        }
Ejemplo n.º 5
0
        public void ExceptWith(IEnumerable <T> other)
        {
            var otherHashSet = new HashSet <T>(other);

            _Letter = LetterSimpleSetFactoryBuilder.Factory.GetDefault(_Letter.Where(n => !otherHashSet.Contains(n)));
        }
Ejemplo n.º 6
0
 public void IntersectWith(IEnumerable <T> other)
 {
     _Letter = LetterSimpleSetFactoryBuilder.Factory.GetDefault(other.Where(_Letter.Contains));
 }
Ejemplo n.º 7
0
 public HybridSet(IEnumerable <T> items)
 {
     _Letter = Factory.GetDefault(items);
 }
Ejemplo n.º 8
0
 public HybridSet(T firstitem)
 {
     _Letter = Factory.GetDefault(firstitem);
 }
Ejemplo n.º 9
0
 public HybridSet()
 {
     _Letter = Factory.GetDefault <T>();
 }
Ejemplo n.º 10
0
 public void Clear()
 {
     _Letter = Factory.GetDefault <T>();
 }
Ejemplo n.º 11
0
        public ILetterSimpleSet <T> OnRemove <T>(SimpleHashSet <T> current)
        {
            ILetterSimpleSet <T> listSet = current;

            return((current.Count == _MaxList - 1) ? new ListSet <T>(this, current, _MaxList) : listSet);
        }
Ejemplo n.º 12
0
 public ILetterSimpleSet <T> OnAdd <T>(ILetterSimpleSet <T> current)
 {
     return((current.Count == _MaxList) ? new SimpleHashSet <T>(this, current) : current);
 }