//[System.Diagnostics.Conditional("DEBUG")] public static void TraceDiff(string msg = null, object id = null) { id = id ?? ""; try { var watch = watches.OptionGetValue(id); if (watch.IsSome) { watch.Get().Stop(); } } catch { watches.Remove(id); } Trace(msg, 2, traceDiffId: Option.GetSome(id)); }
public void NotFoundElementContainsNoValue() { const string key = "Whatchu tawkin' 'bout"; const string value = "Willis"; var dictionary = new Dictionary<string, string> { {key, value} }; var actual = dictionary.OptionGetValue("Arnold"); actual.AssertNone(); }
public void FoundNullElementContainsNoValue() { const string key = "Whatchu tawkin' 'bout"; const string value = null; var dictionary = new Dictionary<string, string> { {key, value} }; var actual = dictionary.OptionGetValue(key); actual.AssertNone(); }
public void FoundNullableElementContainsValue() { const string key = "Whatchu tawkin' 'bout"; const int expected = 1; var dictionary = new Dictionary<string, int?> { {key, expected} }; var actual = dictionary.OptionGetValue(key); actual.AssertSomeAnd(Is.EqualTo(expected)); }
public void FoundNullNullableElementContainsNoValue() { const string key = "Whatchu tawkin' 'bout"; int? value = null; var dictionary = new Dictionary<string, int?> { // ReSharper disable once ExpressionIsAlwaysNull {key, value} }; var actual = dictionary.OptionGetValue(key); actual.AssertNone(); }
public void NotFoundNullableElementContainsNoValue() { const string key = "Whatchu tawkin' 'bout"; const int value = 1; var dictionary = new Dictionary<string, int?> { {key, value} }; var actual = dictionary.OptionGetValue("Arnold"); actual.AssertNone(); }