コード例 #1
0
        public void WhenConvertingObjectToJsonDecimalsArePaddedWithUpToEightZerosForFullValues()
        {
            var input = new TestClassForConverter
            {
                Amount = 9m
            };
            var result = JsonConvert.SerializeObject(input, this.jsonSerializerSettings);

            this.console.WriteLine(result);
            Assert.Equal("{\"Amount\":9.00000000}", result);
        }
コード例 #2
0
        public void WhenConvertingObjectToJsonAndThereAreMoreThanEightPlaces()
        {
            var input = new TestClassForConverter
            {
                Amount = 1.123456789m
            };
            var result = JsonConvert.SerializeObject(input, this.jsonSerializerSettings);

            this.console.WriteLine(result);
            Assert.Equal("{\"Amount\":1.123456789}", result);  //is this correct?
        }