public void Should_throw_not_found_exception_when_applying_conflict_on_missing_file()
        {
            var client = NewAsyncClient(1);

            var guid           = Guid.NewGuid().ToString();
            var innerException = SyncTestUtils.ExecuteAndGetInnerException(async() =>
                                                                           await client.Synchronization.ApplyConflictAsync("test.bin", 8, guid, new RavenJObject(), "http://localhost:12345"));

            Assert.IsType <FileNotFoundException>(innerException.GetBaseException());
        }
예제 #2
0
        public async Task Should_refuse_to_upload_file_while_sync_configuration_exists()
        {
            IAsyncFilesCommands destinationClient;
            IAsyncFilesCommands sourceClient;

            UploadFilesSynchronously(out sourceClient, out destinationClient);

            await destinationClient.Configuration.SetKeyAsync(RavenFileNameHelper.SyncLockNameForFile("test.bin"), SynchronizationConfig(DateTime.UtcNow));

            var innerException = SyncTestUtils.ExecuteAndGetInnerException(async() => await destinationClient.UploadAsync("test.bin", new MemoryStream()));

            Assert.IsType(typeof(SynchronizationException), innerException.GetBaseException());
            Assert.Equal(string.Format("File {0} is being synced", FileHeader.Canonize("test.bin")), innerException.GetBaseException().Message);
        }