Exemplo n.º 1
0
        public void Add_NoExistingValues_AddsElementToTheRepository(TestType value, Guid tag, long timestamp)
        {
            _ourSetService.DownstreamAdd(value, tag, timestamp);

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

            Assert.Single(actualValues);
        }
Exemplo n.º 2
0
        public void MergeAdds_SingleValueWithEmptyRepository_AddsElementsToTheRepository(TestType value, Guid tag, long timestamp)
        {
            var element = new OUR_SetElement <TestType>(value, tag, timestamp);

            _orSetService.Merge(new List <OUR_SetElement <TestType> > {
                element
            }.ToImmutableHashSet(), ImmutableHashSet <OUR_SetElement <TestType> > .Empty);

            var repositoryValues = _repository.GetAdds();

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