internal void UpdateProgress_Updates_AverageSpeed_On_Subsequent_Call() { var d = new TransferInternal(TransferDirection.Download, string.Empty, string.Empty, 0); Assert.Equal(0, d.AverageSpeed); d.SetField("progressUpdateLimit", 0); d.SetProperty("State", TransferStates.InProgress); d.InvokeMethod("UpdateProgress", 100000); var v1 = d.AverageSpeed; Assert.NotEqual(0, v1); d.InvokeMethod("UpdateProgress", 10); Assert.NotEqual(v1, d.AverageSpeed); }
internal void UpdateProgress_Ignores_AverageSpeed_If_StarTime_And_lastProgressTime_Is_Null() { var d = new TransferInternal(TransferDirection.Download, string.Empty, string.Empty, 0); Assert.Equal(0, d.AverageSpeed); d.InvokeMethod("UpdateProgress", 100000); Assert.Equal(0, d.AverageSpeed); }
internal void UpdateProgress_Sets_AverageSpeed_To_Initial_Value() { var d = new TransferInternal(TransferDirection.Download, string.Empty, string.Empty, 0); Assert.Equal(0, d.AverageSpeed); d.SetField("progressUpdateLimit", 0); d.SetProperty("State", TransferStates.InProgress); d.InvokeMethod("UpdateProgress", 100000); Assert.NotEqual(0, d.AverageSpeed); }