Exemplo n.º 1
0
            public async Task DestroyBlob_DisconnectedDuringDestroy()
            {
                var blobIds = new ulong[1024 * 1024];

                Func <Task> f = () => _session.DestroyBlobsAsync(blobIds);

                var assertion = Task.Run(() => f.ShouldThrowAsync <RHostDisconnectedException>());
                await _session.StopHostAsync();

                await assertion;
            }
Exemplo n.º 2
0
            public async Task DestroyBlob_DisconnectedDuringDestroy()
            {
                var blobIds = new ulong[1024 * 1024];
                ManualResetEvent testStarted = new ManualResetEvent(false);

                Func <Task> f = () => _session.DestroyBlobsAsync(blobIds);

                var assertion = f.ShouldThrowAsync <RHostDisconnectedException>();
                await _session.StopHostAsync();

                await assertion;
            }
Exemplo n.º 3
0
 public async Task DestroyBlob_DisconnectedFromTheStart()
 {
     using (var session = new RSession(0, _brokerConnector, () => { })) {
         var         blobids = new ulong[] { 1, 2, 3, 4, 5 };
         Func <Task> f       = () => session.DestroyBlobsAsync(blobids);
         await f.ShouldThrowAsync <RHostDisconnectedException>();
     }
 }
Exemplo n.º 4
0
 public async Task DestroyBlob_DisconnectedFromTheStart()
 {
     using (var session = new RSession(0, _testMethod.FileSystemSafeName, _fileSystem, _brokerClient, new AsyncReaderWriterLock().CreateExclusiveReaderLock(), () => { })) {
         var         blobids = new ulong[] { 1, 2, 3, 4, 5 };
         Func <Task> f       = () => session.DestroyBlobsAsync(blobids);
         await f.ShouldThrowAsync <RHostDisconnectedException>();
     }
 }