public void Add_WithExistingValues_AddsElementToTheRepository(HashSet <OR_OptimizedSetElement <TestType> > adds, TestType value, Guid tag)
        {
            _repository.PersistElements(adds.ToImmutableHashSet());

            _orSetService.DownstreamAdd(value, tag);

            var repositoryValues = _repository.GetElements();
            var actualValues     = repositoryValues.Where(v => Equals(v.Value, value) && v.Tag == tag);

            Assert.Single(actualValues);
        }
Exemple #2
0
        public void MergeAdds_SingleElement_AddsElementsToTheRepository(HashSet <OR_OptimizedSetElement <TestType> > existingValues, TestType value, Guid tag)
        {
            _repository.PersistElements(existingValues.ToImmutableHashSet());

            var element = new OR_OptimizedSetElement <TestType>(value, tag, false);

            _orSetService.Merge(new HashSet <OR_OptimizedSetElement <TestType> > {
                element
            }.ToImmutableHashSet());

            var repositoryValues = _repository.GetElements();

            Assert.Equal(1, repositoryValues.Count(x => Equals(x, element)));
        }