public void TestSynchronizationStateUpToDate() { using (var persistence = GetPersistence()) { var user = persistence.CreateUser(_userDto.Login, _userDto.HashedPassword); persistence.CreateDisk(user, new DiskOptionsDto()); var s = new DiskServiceImpl(persistence); var clonedDisk = s.Disks(user).First(); Assert.AreEqual(SynchronizationState.UpToDate, s.FetchSynchronizationState(user, clonedDisk)); } }
public void TestSynchronizationStateRemoteChanges() { using (var persistence = GetPersistence()) { var user = persistence.CreateUser(_userDto.Login, _userDto.HashedPassword); var disk = persistence.CreateDisk(user, new DiskOptionsDto()); disk.LocalVersion = 10; disk.LastServerVersion = 10; persistence.UpdateDisk(disk); var s = new DiskServiceImpl(persistence); var clonedDisk = new DiskDto { LastServerVersion = 9, LocalVersion = 9, UserId = user.Id, Id = disk.Id }; Assert.AreEqual(SynchronizationState.RemoteChanges, s.FetchSynchronizationState(user, clonedDisk)); } }