public async Task TestShouldBeAbleToMakePostCallsWithNullValues() { var config = new ApiBaseConfig() { settings = new List <string>() { "http://localhost:8443" }, name = "petstore", retryCount = 0, timeout = TimeSpan.FromMinutes(1) }; var pet = new Pet("dog", new List <string>(), null, null, new List <Tag>(), "good"); var client = new SwaggerPetstore(config); var result = await client.AddPetAsync(pet); Assert.AreEqual(200, result.HttpCode); }
public async Task TestShouldSerializeDateTime() { var config = new ApiBaseConfig() { settings = new List <string>() { "http://localhost:8443" }, name = "petstore", retryCount = 0, timeout = TimeSpan.FromMinutes(1) }; var client = new SwaggerPetstore(config); var result = await client.GetOrderByIdAsync(1); // 2019-04-30T04:36:59.348Z const long timeInTicks = 636921958193480000L; Assert.AreEqual(new DateTime(timeInTicks), result.ShipDate); }
public async Task TestShouldSerializeBasicDataTypes() { var config = new ApiBaseConfig() { settings = new List <string>() { "http://localhost:8443" }, name = "petstore", retryCount = 0, timeout = TimeSpan.FromMinutes(1) }; var client = new SwaggerPetstore(config); var result = await client.GetPetByIdAsync(1); List <Tag> expectedTag = new List <Tag>(); expectedTag.Add(new Tag(2, "Beagle")); Assert.AreEqual(result.Id, 1); Assert.AreEqual(result.Category.Name, "Dog"); Assert.IsTrue(TagEqual(result.Tags, expectedTag)); }