Beispiel #1
0
 public static ShouldOverwriteCallback GetDefaultOverwiteCallbackN()
 {
     return((source, dest) =>
     {
         Test.Info("Overwrite false: {0} -> {1}", DMLibTestHelper.TransferInstanceToString(source), DMLibTestHelper.TransferInstanceToString(dest));
         return false;
     });
 }
Beispiel #2
0
 public static ShouldOverwriteCallbackAsync GetDefaultOverwiteCallbackN()
 {
     return(async(source, dest) =>
     {
         return await Task.Run <bool>(() =>
         {
             Thread.Sleep((new Random()).Next(100, 500));
             Test.Info("Overwrite false: {0} -> {1}", DMLibTestHelper.TransferInstanceToString(source), DMLibTestHelper.TransferInstanceToString(dest));
             return false;
         });
     });
 }
Beispiel #3
0
        public void Apply(TransferContext context)
        {
            context.FileTransferred += (sender, transferEventArgs) =>
            {
                Test.Info("Transfer succeeds: {0} -> {1}", DMLibTestHelper.TransferInstanceToString(transferEventArgs.Source), DMLibTestHelper.TransferInstanceToString(transferEventArgs.Destination));
                this.Increase(TransferEventType.Transferred);
            };

            context.FileSkipped += (sender, transferEventArgs) =>
            {
                Test.Info("Transfer skips: {0} -> {1}", DMLibTestHelper.TransferInstanceToString(transferEventArgs.Source), DMLibTestHelper.TransferInstanceToString(transferEventArgs.Destination));
                this.Increase(TransferEventType.Skippied);
            };

            context.FileFailed += (sender, transferEventArgs) =>
            {
                Test.Info("Transfer fails: {0} -> {1}", DMLibTestHelper.TransferInstanceToString(transferEventArgs.Source), DMLibTestHelper.TransferInstanceToString(transferEventArgs.Destination));
                Test.Info("Exception: {0}", transferEventArgs.Exception.ToString());
                this.Increase(TransferEventType.Failed);
            };
        }