当前位置: 首页>>代码示例>>C#>>正文


C# ApiClient.ParameterToString方法代码示例

本文整理汇总了C#中IO.Swagger.Client.ApiClient.ParameterToString方法的典型用法代码示例。如果您正苦于以下问题:C# ApiClient.ParameterToString方法的具体用法?C# ApiClient.ParameterToString怎么用?C# ApiClient.ParameterToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IO.Swagger.Client.ApiClient的用法示例。


在下文中一共展示了ApiClient.ParameterToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestParameterToStringForDateTime

		public void TestParameterToStringForDateTime ()
		{
			ApiClient api = new ApiClient ();

			// test datetime
			DateTime dateUtc = DateTime.Parse ("2008-04-10T13:30:00.0000000z", null, System.Globalization.DateTimeStyles.RoundtripKind);
			Assert.AreEqual ("2008-04-10T13:30:00.0000000Z", api.ParameterToString (dateUtc));

			// test datetime with no timezone
			DateTime dateWithNoTz = DateTime.Parse ("2008-04-10T13:30:00.000", null, System.Globalization.DateTimeStyles.RoundtripKind);
			Assert.AreEqual ("2008-04-10T13:30:00.0000000", api.ParameterToString (dateWithNoTz));
		}
开发者ID:ckaeslin,项目名称:swagger-codegen,代码行数:12,代码来源:ApiClientTests.cs

示例2: TestParameterToString

		public void TestParameterToString ()
		{	
			ApiClient api = new ApiClient ();

			// test array of string
			List<string> statusList = new List<String>(new String[] {"available", "sold"});
			Assert.AreEqual("available,sold", api.ParameterToString (statusList));

			// test array of int
			List<int> numList = new List<int>(new int[] {1, 37});
			Assert.AreEqual("1,37", api.ParameterToString (numList));
		}
开发者ID:ckaeslin,项目名称:swagger-codegen,代码行数:12,代码来源:ApiClientTests.cs

示例3: TestParameterToStringWithTimeZoneForDateTime

		public void TestParameterToStringWithTimeZoneForDateTime ()
		{
			ApiClient api = new ApiClient ();
			// test datetime with a time zone
			DateTimeOffset dateWithTz = DateTimeOffset.Parse("2008-04-10T13:30:00.0000000-04:00", null, System.Globalization.DateTimeStyles.RoundtripKind);
			Assert.AreEqual("2008-04-10T13:30:00.0000000-04:00", api.ParameterToString(dateWithTz));
		}
开发者ID:ckaeslin,项目名称:swagger-codegen,代码行数:7,代码来源:ApiClientTests.cs

示例4: TestParameterToStringForDateTimeWithUFormat

        public void TestParameterToStringForDateTimeWithUFormat()
        {
            // Setup the DateTimeFormat across all of the calls
            Configuration.Default.DateTimeFormat = "u";
            ApiClient api = new ApiClient();

            // test datetime
            DateTime dateUtc = DateTime.Parse("2009-06-15 20:45:30Z", null, System.Globalization.DateTimeStyles.RoundtripKind);
            Assert.AreEqual("2009-06-15 20:45:30Z", api.ParameterToString(dateUtc));
        }
开发者ID:worldline,项目名称:swagger-codegen,代码行数:10,代码来源:TestApiClient.cs

示例5: TestParameterToString_DateTime_WithCustomFormat

        public void TestParameterToString_DateTime_WithCustomFormat()
        {
            // Setup the DateTimeFormat across all of the calls
            Configuration.DateTimeFormat = "dd/MM/yy HH:mm:ss";
            ApiClient api = new ApiClient();

            // test datetime
            DateTime dateUtc = DateTime.Parse("2009-06-15 20:45:30Z", null, System.Globalization.DateTimeStyles.RoundtripKind);
            Assert.AreEqual("15/06/09 20:45:30", api.ParameterToString(dateUtc));
        }
开发者ID:romerod,项目名称:swagger-codegen,代码行数:10,代码来源:TestApiClient.cs


注:本文中的IO.Swagger.Client.ApiClient.ParameterToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。