コード例 #1
0
 //[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));
 }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        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();
        }