コード例 #1
0
        public void ConvertObject()
        {
            var datum = datumConverter.ConvertObject(TimeSpan.FromSeconds(70.987));

            Assert.That(datum, Is.Not.Null);
            Assert.That(datum.type, Is.EqualTo(Datum.DatumType.R_NUM));
            Assert.That(datum.r_num, Is.EqualTo(70.987));
        }
コード例 #2
0
        public void EmitDefaultValueOnStructProperty()
        {
            var obj = new TestObjectStructEmitDefaultValueProperty()
            {
                Name = "Jackpot!"
            };
            var datum = testObjectStructEmitDefaultValuePropertyConverter.ConvertObject(obj);

            Assert.That(datum.type, Is.EqualTo(Datum.DatumType.R_OBJECT));
            Assert.That(datum.r_object.Count, Is.EqualTo(1));

            var pair = datum.r_object[0];

            Assert.That(pair.key, Is.EqualTo("name"));
            Assert.That(pair.val.type, Is.EqualTo(Datum.DatumType.R_STR));
            Assert.That(pair.val.r_str, Is.EqualTo("Jackpot!"));
        }
コード例 #3
0
        public void PropertyDataContractConvertObject()
        {
            var obj = new TestObject4()
            {
                Name = "Jackpot!",
            };
            var datum = testObject4Converter.ConvertObject(obj);

            Assert.That(datum.type, Is.EqualTo(Datum.DatumType.R_OBJECT));
            Assert.That(datum.r_object.Count, Is.EqualTo(1));

            var pair = datum.r_object[0];

            Assert.That(pair.key, Is.EqualTo("name"));
            Assert.That(pair.val.type, Is.EqualTo(Datum.DatumType.R_STR));
            Assert.That(pair.val.r_str, Is.EqualTo("Jackpot!"));
        }
コード例 #4
0
        public void ConvertObject()
        {
            var datum = datumConverter.ConvertObject(5);

            Assert.That(datum.type, Is.EqualTo(Datum.DatumType.R_NUM));
        }