Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected async Task<ResourceGroupResource> CreateResourceGroupAsync()

protected MapsAccountData GetDefaultMapsAccountData()
{
var account = new MapsAccountData(DefaultLocation, new MapsSku(MapsSkuName.S0))
var account = new MapsAccountData(DefaultLocation, new MapsSku(MapsSkuName.G2))
{
Tags = { { "key1", "value1" }, { "key2", "value2" } }
};
Expand All @@ -68,7 +68,7 @@ public void VerifyAccountProperties(MapsAccountData account, bool useDefaults, M
if (useDefaults)
{
Assert.AreEqual("East US", account.Location.DisplayName);
Assert.AreEqual(MapsSkuName.S0, account.Sku.Name);
Assert.AreEqual(MapsSkuName.G2, account.Sku.Name);

Assert.NotNull(account.Tags);
Assert.NotNull(account.Properties.UniqueId);
Expand All @@ -88,7 +88,7 @@ public async Task<MapsAccountResource> CreateDefaultMapsAccount(MapsAccountColle
var accountName = Recording.GenerateAssetName("maps");
var parameters = GetDefaultMapsAccountData();
var newAccount = (await mapCollection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, parameters)).Value;
VerifyAccountProperties(newAccount.Data, true, MapsSkuName.S0);
VerifyAccountProperties(newAccount.Data, true, MapsSkuName.G2);
return newAccount;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public async Task MapsAccountCreateTest()

// Create account
var newAccount = (await mapCollection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, parameters)).Value;
VerifyAccountProperties(newAccount.Data, true, MapsSkuName.S0);
VerifyAccountProperties(newAccount.Data, true, MapsSkuName.G2);

// Now get the account
var account = (await mapCollection.GetAsync(accountName)).Value;
VerifyAccountProperties(account.Data, true, MapsSkuName.S0);
VerifyAccountProperties(account.Data, true, MapsSkuName.G2);

// Now delete the account
await account.DeleteAsync(WaitUntil.Completed);
Expand All @@ -59,16 +59,14 @@ public async Task MapsAccountUpdateTest()

// Create account
var newAccount = (await mapCollection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, parameters)).Value;
VerifyAccountProperties(newAccount.Data, true, MapsSkuName.S0);
VerifyAccountProperties(newAccount.Data, true, MapsSkuName.G2);

// Create new parameters which are almost the same, but have different tags
var newParameters = GetDefaultMapsAccountData();
newParameters.Tags.Clear();
newParameters.Tags.Add("key3", "value3");
newParameters.Tags.Add("key4", "value4");
newParameters.Sku.Name = MapsSkuName.S1;
var updatedAccount = (await mapCollection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, newParameters)).Value;
VerifyAccountProperties(updatedAccount.Data, false, skuName: MapsSkuName.S1);
Assert.AreEqual(2, updatedAccount.Data.Tags.Count);
Assert.AreEqual("value3", updatedAccount.Data.Tags["key3"]);
Assert.AreEqual("value4", updatedAccount.Data.Tags["key4"]);
Expand Down Expand Up @@ -111,8 +109,8 @@ public async Task MapsAccountListByResourceGroupTest()
accounts = await mapCollection.GetAllAsync().ToEnumerableAsync();
Assert.AreEqual(2, accounts.Count);

VerifyAccountProperties(accounts.First().Data, true, MapsSkuName.S0);
VerifyAccountProperties(accounts.Skip(1).First().Data, true, MapsSkuName.S0);
VerifyAccountProperties(accounts.First().Data, true, MapsSkuName.G2);
VerifyAccountProperties(accounts.Skip(1).First().Data, true, MapsSkuName.G2);
}

[Test]
Expand All @@ -134,11 +132,11 @@ public async Task MapsAccountListBySubscriptionTest()

var account1 = accounts.First(
t => StringComparer.OrdinalIgnoreCase.Equals(t.Data.Name, accountName1.Data.Name));
VerifyAccountProperties(account1.Data, true, MapsSkuName.S0);
VerifyAccountProperties(account1.Data, true, MapsSkuName.G2);

var account2 = accounts.First(
t => StringComparer.OrdinalIgnoreCase.Equals(t.Data.Name, accountName2.Data.Name));
VerifyAccountProperties(account2.Data, true, MapsSkuName.S0);
VerifyAccountProperties(account2.Data, true, MapsSkuName.G2);
}

[Test]
Expand Down
Loading