コード例 #1
0
ファイル: JsonMappingSuite.cs プロジェクト: vc3/ExoModel
        public void TestCreation()
        {
            string mapping = @"[{PropertyPath : 'Number',Expression : '[Location #]'}, {PropertyPath : 'ServiceAddress.Line1',Expression : '[Full Service Address]'}, {PropertyPath : 'ServiceAddress.City',Expression : '[Service City]'}]";

            JsonMapping map = new JsonMapping(mapping);
            ExpressionToProperty test = new ExpressionToProperty();
            test.Expression = "[Service City]";
            test.PropertyPath = "ServiceAddress.City";

            Assert.AreEqual(3, map.GetMapping().Count());
            Assert.AreEqual(true, test.Equals(map.GetMapping().ElementAt(2)));
        }
コード例 #2
0
        public void TestCreation()
        {
            string mapping = @"[{PropertyPath : 'Number',Expression : '[Location #]'}, {PropertyPath : 'ServiceAddress.Line1',Expression : '[Full Service Address]'}, {PropertyPath : 'ServiceAddress.City',Expression : '[Service City]'}]";

            JsonMapping          map  = new JsonMapping(mapping);
            ExpressionToProperty test = new ExpressionToProperty();

            test.Expression   = "[Service City]";
            test.PropertyPath = "ServiceAddress.City";

            Assert.AreEqual(3, map.GetMapping().Count());
            Assert.AreEqual(true, test.Equals(map.GetMapping().ElementAt(2)));
        }