예제 #1
0
        public void SanitizeMeasurementsTrimsLeadingAndTrailingSpaceInKeyNames()
        {
            const string OriginalKey   = " key with spaces ";
            const double OriginalValue = 42.0;
            var          original      = new Dictionary <string, double> {
                { OriginalKey, OriginalValue }
            };

            original.SanitizeMeasurements();

            string sanitizedKey = OriginalKey.Trim();

            Assert.Equal(new[] { new KeyValuePair <string, double>(sanitizedKey, OriginalValue) }, original);
        }
예제 #2
0
        public void SanitizePropertiesTrimsLeadingAndTrailingSpaceInKeyNames()
        {
            const string OriginalKey   = " key with spaces ";
            const string OriginalValue = "Test Value";
            var          original      = new Dictionary <string, string> {
                { OriginalKey, OriginalValue }
            };

            original.SanitizeProperties();

            string sanitizedKey = OriginalKey.Trim();

            Assert.Equal(new[] { new KeyValuePair <string, string>(sanitizedKey, OriginalValue) }, original);
        }