示例#1
0
            public static ConfigurationValue BuildSingleConfig(params Tag[] tags)
            {
                var results = new ConfigurationValue()
                {
                    Id         = 1,
                    XML        = @"<Customers>
				        <Customer CustomerID=""GREAL"">
				          <CompanyName>Great Lakes Food Market</CompanyName>
				          <ContactName>Howard Snyder</ContactName>
				          <ContactTitle>Marketing Manager</ContactTitle>
				          <Phone>(503) 555-7555</Phone>
				          <FullAddress>
					        <Address>2732 Baker Blvd.</Address>
					        <City>Eugene</City>
					        <Region>OR</Region>
					        <PostalCode>97403</PostalCode>
					        <Country>USA</Country>
				          </FullAddress>
				        </Customer>
			          </Customers>"            ,
                    JSON       = @"{
                       ""Customers"":{
                          ""Customer"":[
                             {
                                ""@CustomerID"":""GREAL"",
                                ""CompanyName"":""Great Lakes Food Market"",
                                ""ContactName"":""Howard Snyder"",
                                ""ContactTitle"":""Marketing Manager"",
                                ""Phone"":""(503) 555-7555"",
                                ""FullAddress"":{
                                   ""Address"":""2732 Baker Blvd."",
                                   ""City"":""Eugene"",
                                   ""Region"":""OR"",
                                   ""PostalCode"":""97403"",
                                   ""Country"":""USA""
                                }
                             }
                          ]
                       }
                    }",
                    XMLSchema  = XMLSchema,
                    JSONSchema = JsonSchema,
                    Name       = "Customer",
                    SystemName = "Test System",
                };

                results.AssignTags(tags);
                return(TrimWhiteSpace(results));
            }
示例#2
0
            public static ConfigurationValue BuildSingleConfig(params Tag[] tags)
            {
                var results = new ConfigurationValue()
                {
                    Id         = 1,
                    XML        = @"<Books>
                                <Book Id=""bk101"">
                                    <Author>Gambardella, Matthew</Author>
                                    <Title>XML Developer's GuIde</Title>
                                    <Genre>Computer</Genre>
                                    <Price>44.95</Price>
                                    <PublishDate>2000-10-01</PublishDate>
                                    <Description>An in-depth look at creating applications 
                                    with XML.</Description>
                                </Book>
                            </Books>",
                    JSON       = @"{
                              ""Books"": {
                                ""Book"": [
                                  {
                                                ""@Id"": ""bk101"",
                                    ""Author"": ""Gambardella, Matthew"",
                                    ""Title"": ""XML Developer's GuIde"",
                                    ""Genre"": ""Computer"",
                                    ""Price"": ""44.95"",
                                    ""PublishDate"": ""2000-10-01"",
                                    ""Description"": ""An in-depth look at creating applications \r\n                                    with XML.""
                                  }
                                ]
                              }
                    }",
                    XMLSchema  = XMLSchema,
                    JSONSchema = JsonSchema,
                    Name       = "Customer",
                    SystemName = "Test System"
                };

                results.AssignTags(tags);

                return(TrimWhiteSpace(results));
            }