コード例 #1
0
        public void TestPutMetaData()
        {
            string expectedKey   = "testKey";
            string expectedValue = "testValue";

            _metricsLogger.PutMetadata(expectedKey, expectedValue);
            _metricsLogger.Flush();

            var rootNode = typeof(MetricsContext)
                           .GetField("_rootNode", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)
                           .GetValue(_sink.MetricsContext) as RootNode;

            rootNode.AWS.CustomMetadata.TryGetValue(expectedKey, out var actualValue);

            Assert.Equal(expectedValue, actualValue);
        }