public async Task TestQuery()
{
var digits = DateTime.Now.Ticks.ToString();
var domainName = string.Format("net-sdk-test-{0}", digits.Substring(digits.Length - 15));
using (var client = UtilityMethods.CreateClient<AmazonCloudSearchClient>())
{
await client.CreateDomainAsync(new CreateDomainRequest
{
DomainName = domainName
});
try
{
var domains = (await client.ListDomainNamesAsync(new ListDomainNamesRequest())).DomainNames;
Assert.NotNull(domains);
Assert.NotEqual(0, domains.Count);
}
finally
{
await client.DeleteDomainAsync(new DeleteDomainRequest
{
DomainName = domainName
});
}
var fakeDomain = new string('a', 30); // service defines valid domains as 28 characters long
await AssertExtensions.ExpectExceptionAsync(client.DeleteDomainAsync(new DeleteDomainRequest
{
DomainName = fakeDomain
}));
}
}
}