コード例 #1
0
        public void GetConflictingItems_ChangesHaveNoConflicts_NoConflictsInSyncResult()
        {
            // Create non conflicting items
            Guid id          = Guid.NewGuid();
            var  serverStamp = new Stamp();
            var  clientStamp = serverStamp.Fork();
            var  serverItem  = new TestItem {
                Id = id, Stamp = serverStamp
            };
            var clientItem = new TestItem {
                Id = id, Stamp = clientStamp
            };

            // Arrange server repository to return server item
            var repository = Mocking.MockAndBind <IRepository <TestItem, Guid> >(_container);

            Mock.Arrange(() => repository.Find(id)).Returns(serverItem);

            // Arrange client sync request
            ISyncRequest <Guid> syncRequest = new SyncRequest <TestItem, Guid> {
                new SyncItem <Guid>(clientItem)
            };

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

            target.GetConflictingItems(syncRequest);

            Assert.IsFalse(target.ConflictingItems.Contains(serverItem));
        }