public void SortedSetSyncProviderShouldHaveAValidStringForNonNullableItems()
        {
            var provider = new SortedSetSyncProvider <int>();

            provider.Items = new SortedSet <int>();
            provider.Items.Add(1);

            provider.ToString().Should().Be(provider.Items.ToString());
        }
        public async Task SyncWithExternalComparerAgent(SyncModePreset syncModePreset)
        {
            var syncAgent = CreateSyncAgent();
            SortedSetSyncProvider <Event> source = new SortedSetSyncProvider <Event> {
                Items = CreateSourceEventSortedSet()
            }
            , destination = new SortedSetSyncProvider <Event> {
                Items = CreateDestinationEventSortedSet()
            };

            var comparisonResult = await ComparerAgent <int?, Event> .Create()
                                   .Configure((c) =>
            {
                c.AllowDuplicateKeys  = RuleAllowanceType.None;
                c.AllowDuplicateItems = RuleAllowanceType.None;
                c.AllowNullableItems  = RuleAllowanceType.None;
            })
                                   .SetKeySelector(x => x.Id)
                                   .SetCompareItemFunc((s, d) =>
            {
                if (s.Title == d.Title && s.ModifiedDate == d.ModifiedDate)
                {
                    return(MatchComparisonResultType.Same);
                }
                else if (s.ModifiedDate < d.ModifiedDate)
                {
                    return(MatchComparisonResultType.NewerDestination);
                }
                else if (s.ModifiedDate > d.ModifiedDate)
                {
                    return(MatchComparisonResultType.NewerSource);
                }
                else
                {
                    return(MatchComparisonResultType.Conflict);
                }
            })
                                   .SetSourceProvider(source)
                                   .SetDestinationProvider(destination)
                                   .CompareAsync(CancellationToken.None);

            await syncAgent
            .Configure((c) => c.SyncMode.SyncModePreset = syncModePreset)
            .SetComparerAgent(null)
            .SetSourceProvider((ISyncProvider <Event>)source)
            .SetDestinationProvider((ISyncProvider <Event>)destination)
            .SyncAsync(comparisonResult, CancellationToken.None).ConfigureAwait(false);

            source.Items.Should().BeEquivalentTo(destination.Items);
        }
        public void SortedSetSyncProviderShouldHaveAValidStringForNullableItems()
        {
            var provider = new SortedSetSyncProvider <int>();

            provider.ToString().Should().NotBeNullOrWhiteSpace();
        }