[banshee] MediaEngineTests: honor String.Format() usage in assertion msg



commit 112bc3e7aa962bdbd039a3d61bda855ffc0dc7bc
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Mon Jan 20 00:09:14 2014 +0100

    MediaEngineTests: honor String.Format() usage in assertion msg
    
    This assertion message was using String.Format() when in fact
    there was no need to do so, as there was no parameter interpolation
    at all. However, instead of just removing the call to String.Format
    we can improve this slightly to include the number of seconds
    waited as a parameter. This way, in case this number changes in
    the future, we will only need to change one line and not two.
    
    The last reason to use 3 seconds is mentioned in this commit:
    https://git.gnome.org/browse/banshee/commit/?id=2212116a814640ffce06ae2fe0fb8f00a0de10f0

 .../Banshee.Services/Banshee.MediaEngine/Tests.cs  |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs 
b/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs
index a2f4ac8..90b1b83 100644
--- a/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs
+++ b/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs
@@ -205,10 +205,11 @@ namespace Banshee.MediaEngine
 
             if (action != null) action ();
 
+            const int seconds = 3;
             while (result_count < states.Length) {
                 reset_event.Reset ();
-                if (!reset_event.WaitOne (3000)) {
-                    Assert.Fail (String.Format ("Waited 3s for state/event, didn't happen"));
+                if (!reset_event.WaitOne (TimeSpan.FromSeconds (seconds))) {
+                    Assert.Fail (String.Format ("Waited {0}s for state/event, didn't happen", seconds));
                     break;
                 }
             }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]