public static void Cleanup() { if (!string.IsNullOrEmpty(CREATED_THING_NAME)) { using (var iotClient = new AmazonIoTClient()) { iotClient.DeleteThing(CREATED_THING_NAME); } } if (Client != null) { Client.Dispose(); } }
public static void ClassInitialize(TestContext testContext) { Client = new AmazonIotDataClient("https://data.iot.us-east-1.amazonaws.com/"); using (var iotClient = new AmazonIoTClient()) { var things = iotClient.ListThings().Things; var firstThing = things.FirstOrDefault(); if (firstThing == null) { THING_NAME = "dotnettest" + DateTime.UtcNow.ToFileTime(); iotClient.CreateThing(new CreateThingRequest { ThingName = THING_NAME }); CREATED_THING_NAME = THING_NAME; } else { THING_NAME = firstThing.ThingName; } } }