Exemplo n.º 1
0
        public void WhenConvertingObjectToJsonDecimalsArePaddedWithUpToEightZerosForFullValues()
        {
            var input = new TestClassForConverter
            {
                Amount = 9m
            };
            string result = JsonConvert.SerializeObject(input, this.jsonSerializerSettings);

            this.console.WriteLine(result);
            Assert.Equal("{\"Amount\":9.00000000}", result);
        }
Exemplo n.º 2
0
        public void WhenConvertingObjectToJsonAndThereAreMoreThanEightPlaces()
        {
            var input = new TestClassForConverter
            {
                Amount = 1.123456789m
            };
            string result = JsonConvert.SerializeObject(input, this.jsonSerializerSettings);

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