public void ClonesComplexSuccessfully()
        {
            var original = new FormattedLogValues("The first number is {first} and the second is {second}", 10.ToString(), 20.ToString());
            var cloned   = original.Clone();

            Assert.Equal(original.ToString(), cloned.ToString());
            Assert.True(original.GetValues().SequenceEqual(cloned.GetValues()));
        }
示例#2
0
        public void LogValues_With_Basic_Types(string expected, string format, object[] args)
        {
            var logValues = new FormattedLogValues(format, args);

            Assert.Equal(expected, logValues.ToString());

            // Original format is expected to be returned from GetValues.
            Assert.Equal(format, logValues.GetValues().First(v => v.Key == "{OriginalFormat}").Value);
        }
示例#3
0
        public void LogValues_With_DateTime(string expected, string format)
        {
            var dateTime  = new DateTime(2015, 1, 1, 1, 1, 1);
            var logValues = new FormattedLogValues(format, new object[] { dateTime, dateTime });

            Assert.Equal(expected, logValues.ToString());

            // Original format is expected to be returned from GetValues.
            Assert.Equal(format, logValues.GetValues().First(v => v.Key == "{OriginalFormat}").Value);
        }