Example #1
0
 private void Match(TraceContextInfo realInfo, TraceContextDescriptor expectedInfo)
 {
     Assert.That(Match(realInfo.TraceId, expectedInfo.TraceId), Is.True, "Элементы {0} и {1} не совпали по полю TraceId", InfoToString(realInfo), DescriptorToString(expectedInfo));
     Assert.That(Match(realInfo.ContextId, expectedInfo.ContextId), Is.True, "Элементы {0} и {1} не совпали по полю ContextId", InfoToString(realInfo), DescriptorToString(expectedInfo));
     Assert.That(Match(realInfo.ParentContextId, expectedInfo.ParentContextId), Is.True, "Элементы {0} и {1} не совпали по полю ParentContextId", InfoToString(realInfo), DescriptorToString(expectedInfo));
     Assert.That(Match(realInfo.ContextName, expectedInfo.ContextName), Is.True, "Элементы {0} и {1} не совпали по полю ContextName", InfoToString(realInfo), DescriptorToString(expectedInfo));
     Assert.That(Match(realInfo.IsRoot, expectedInfo.IsRoot), Is.True, "Элементы {0} и {1} не совпали по полю IsRoot", InfoToString(realInfo), DescriptorToString(expectedInfo));
     Assert.That(Match(realInfo.Annotations, expectedInfo.Annotations), Is.True, "Элементы {0} и {1} не совпали по полю Annotations", InfoToString(realInfo), DescriptorToString(expectedInfo));
     Assert.That(Match(realInfo.Timeline, expectedInfo.Timeline), Is.True, "Элементы {0} и {1} не совпали по полю Timeline", InfoToString(realInfo), DescriptorToString(expectedInfo));
 }
Example #2
0
 private string DescriptorToString(TraceContextDescriptor descriptor)
 {
     return(string.Format("[TraceId={0}, ContextId={1}, ParentContextId={2}, ContextName={3}, IsRoot={4}, Annotations={5}, Timeline={6}]",
                          descriptor.TraceId, descriptor.ContextId, descriptor.ParentContextId, descriptor.ContextName, descriptor.IsRoot, DictionaryToString(descriptor.Annotations), DictionaryToString(descriptor.Timeline)));
 }