本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}