public void GivenFieldBOfTheRecordR0HasBeenChangedOnTheServer()
        {
            var r0 = ServerRepository.Find(TestItemR0.Id);

            r0.FieldB = FieldBServerChangedValue = Guid.NewGuid().ToString();
            ServerRepository.Update(r0);
        }
        public void ThenTheServerR0RecordShouldHaveClientValueInFieldAAndServerValueInFieldB()
        {
            var r0 = ServerRepository.Find(TestItemR0.Id);

            Assert.AreEqual(FieldAClientChangedValue, r0.FieldA);
            Assert.AreEqual(FieldBServerChangedValue, r0.FieldB);
        }
 public void GivenTheR0RecordExistsOnTheServer()
 {
     if (ServerRepository.Find(TestItemR0.Id) == null)
     {
         ServerRepository.Insert(TestItemR0);
     }
 }
 public void GivenTheRecordR1DoesNotExistOnTheServer()
 {
     if (ServerRepository.Find(TestItemR1.Id) != null)
     {
         ServerRepository.Delete(TestItemR1.Id);
     }
 }
        public void ThenTheFieldAConflictShouldBeSavedInTheServerRecordR0()
        {
            var r0 = ServerRepository.Find(TestItemR0.Id);

            Assert.AreEqual(1, r0.Conflicts.Count());
            foreach (Conflict <Guid> .ConflictItem conflict in r0.Conflicts.First().ConflictItems)
            {
                string fieldA = ((TestItem)conflict.Item).FieldA;
                if (conflict.Replica.Name == "Server")
                {
                    Assert.AreEqual(FieldAServerChangedValue, fieldA);
                }
                else
                {
                    Assert.AreEqual(FieldAClientChangedValue, fieldA);
                }
            }
        }
        public void ThenTheR0RecordFieldAShouldBeUpdatedOnTheServer()
        {
            var r0 = ServerRepository.Find(TestItemR0.Id);

            Assert.AreEqual(FieldAClientChangedValue, r0.FieldA);
        }
        public void ThenTheR0RecordShouldBeRemovedFromTheServer()
        {
            var result = ServerRepository.Find(TestItemR0.Id);

            Assert.IsNull(result);
        }
        public void ThenTheRecordR1ShouldBeAddedToTheServer()
        {
            var result = ServerRepository.Find(TestItemR1.Id);

            Assert.IsNotNull(result);
        }