public void SendChangedItemsToRemoteReplica_BothParmsHaveChanges_ChangesAggregated()
        {
            IReplica replica   = new Replica("Test");
            var      testItem1 = new TestItem();
            var      testItem2 = new TestItem();

            var requestSender = Mocking.MockAndBind <ISyncRequestSender <TestItem, Guid> >(_container);
            var repository    = Mocking.MockAndBind <IRepository <TestItem, Guid> >(_container);

            Mock.Arrange(() => repository.Find(testItem2.Id)).Returns(testItem2);
            var syncResult = new SyncResult <TestItem, Guid>(_container)
            {
                ChangesRequest = new List <Guid> {
                    testItem2.Id
                }
            };
            var conflictResolutions =
                new ConflictResolutionsToSend <TestItem, Guid> {
                new Resolution <TestItem, Guid>(replica, testItem1)
            };

            var target = new SendingSynchronizer <TestItem, Guid>(_container);

            target.SendChangedItemsToRemoteReplica(syncResult.ChangesRequest, conflictResolutions);

            Mock.Assert(() => requestSender.SendChangedItems(
                            Arg.Matches <IEnumerable <TestItem> >(items => items.Contains(testItem1) && items.Contains(testItem2))));
        }
        public void SendChangedItemsToRemoteReplica__SendsChangesViaRequestSenderForType()
        {
            var requestSender = Mocking.MockAndBind <ISyncRequestSender <TestItem, Guid> >(_container);
            var syncResult    = Mock.Create <ISyncResult <TestItem, Guid> >();
            var target        = new SendingSynchronizer <TestItem, Guid>(_container);
            ConflictResolutionsToSend <TestItem, Guid> conflictResolutions = new ConflictResolutionsToSend <TestItem, Guid>();

            target.SendChangedItemsToRemoteReplica(syncResult.ChangesRequest, conflictResolutions);

            Mock.Assert(() => requestSender.SendChangedItems(Arg.IsAny <IEnumerable <TestItem> >()), Occurs.Once());
        }