Esempio n. 1
0
        public async Task CopyAsync(IReadOnlyList <string> nodes, string destinationDirectory)
        {
            var settings      = GetBinaryFileSystemOperationSettings(nodes, destinationDirectory);
            var copyOperation = _operationsFactory.CreateCopyOperation(settings);

            _operationsStateService.AddOperation(copyOperation);

            await copyOperation.RunAsync();
        }
Esempio n. 2
0
    public void TestAddingOperation()
    {
        Assert.Empty(_operationsStateService.ActiveOperations);

        var callbackCalled = false;
        var operationMock  = new Mock <IOperation>();

        _operationsStateService.OperationStarted += (sender, args) => callbackCalled = true;
        _operationsStateService.AddOperation(operationMock.Object);

        Assert.True(_operationsStateService.ActiveOperations.Count == 1);
        var activeOperation = _operationsStateService.ActiveOperations.Single();

        Assert.True(activeOperation == operationMock.Object);
        Assert.True(callbackCalled);
    }