Exemplo n.º 1
0
 public static void Log ( TimeSpan ts, string actionName, string context, string sDetail )
 {
     Messaging.Bus.Instance.Send (
         new Messaging.StatusMessage (
             Messaging.StatusMessage.Types.Debug,
             context,
             actionName + " took " + ts.ToPrettyString ( ),
             sDetail ) );
 }
Exemplo n.º 2
0
 public static IMatcher<TimeSpan?> BetweenIncluding(TimeSpan expectFrom, TimeSpan expectTo)
 {
     return Matchers.Function((TimeSpan? actual) => actual.IsValidTimeSpan() && expectFrom.SafeCompareTo(actual) <= 0 && expectTo.SafeCompareTo(actual) >= 0, "a TimeSpan where " + expectFrom.ToPrettyString() + " <= value <= " + expectTo.ToPrettyString());
 }
Exemplo n.º 3
0
        public void UtilityToPrettyTime()
        {
            TimeSpan timeSpan = new TimeSpan(3, 6, 27, 38);
            Assert.AreEqual("3d 6h", timeSpan.ToPrettyString());

            timeSpan = new TimeSpan(0, 4, 36, 59, 875);
            Assert.AreEqual("4h 36m", timeSpan.ToPrettyString());

            timeSpan = new TimeSpan(0, 0, 12, 17, 0);
            Assert.AreEqual("12m 17s", timeSpan.ToPrettyString());

            timeSpan = new TimeSpan(0, 0, 0, 2, 850);
            Assert.AreEqual("2.8s", timeSpan.ToPrettyString());

            timeSpan = new TimeSpan(0, 0, 0, 0, 300);
            Assert.AreEqual("0.3s", timeSpan.ToPrettyString());
        }
Exemplo n.º 4
0
 public void TimeSpan_Com_CentoECinquenta_Segundos_TEST()
 {
     TimeSpan t = new TimeSpan(0, 0, 150);
     Assert.AreEqual("2 minutos", t.ToPrettyString());
 }
Exemplo n.º 5
-1
 public static IMatcher<TimeSpan?> Not(TimeSpan expect)
 {
     return Matchers.Function((TimeSpan? actual) => actual.IsValidTimeSpan() && actual != expect, "a TimeSpan != " + expect.ToPrettyString());
 }
Exemplo n.º 6
-1
 public static IMatcher<TimeSpan?> LessThanOrEqualTo(TimeSpan expect)
 {
     return Matchers.Function((TimeSpan? actual) => actual.IsValidTimeSpan() && expect.SafeCompareTo(actual) >= 0, "a TimeSpan <= " + expect.ToPrettyString());
 }
Exemplo n.º 7
-1
 public static IMatcher<TimeSpan?> GreaterThan(TimeSpan expect)
 {
     return Matchers.Function((TimeSpan? actual) => actual.IsValidTimeSpan() && expect.SafeCompareTo(actual) < 0, "a TimeSpan > " + expect.ToPrettyString());
 }
Exemplo n.º 8
-1
 public static IMatcher<TimeSpan?> EqualTo(TimeSpan expect)
 {
     return Matchers.Function((TimeSpan? actual) => actual == expect, "a TimeSpan == " + expect.ToPrettyString());
 }
Exemplo n.º 9
-1
		private void UpdateTimerMessage(TimeSpan timeSpan, bool isCanceling)
		{
			var formattedValue = timeSpan.ToPrettyString();

			if (isCanceling)
			{
				formattedValue = $"Canceling... {formattedValue}";
			}

			StatusInfo.ExecutionTimerMessage = formattedValue;
		}
Exemplo n.º 10
-1
 public void TimeSpan_Com_Trinta_Segundos_TEST()
 {
     TimeSpan t = new TimeSpan(0, 0, 30);
     Assert.AreEqual("30 segundos", t.ToPrettyString());
 }