diff --git a/src/SDKs/Logic/AzSdk.RP.props b/src/SDKs/Logic/AzSdk.RP.props
index 39645fa6dc051..57c4650bfa686 100644
--- a/src/SDKs/Logic/AzSdk.RP.props
+++ b/src/SDKs/Logic/AzSdk.RP.props
@@ -1,7 +1,7 @@
-
+ Logic_2018-07-01-preview;
$(PackageTags);$(CommonTags);$(AzureApiTag);
\ No newline at end of file
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/InMemoryTestsBase.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/InMemoryTestsBase.cs
index 2703421711c26..35f16cf3dfb2c 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/InMemoryTestsBase.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/InMemoryTestsBase.cs
@@ -14,16 +14,6 @@ namespace Test.Azure.Management.Logic
///
abstract public class InMemoryTestsBase
{
- ///
- /// Test resourcegroup name for integration account
- ///
- protected static string ResourceGroupName = Constants.DefaultResourceGroup;
-
- ///
- /// Empty content string
- ///
- protected StringContent Empty = new StringContent(string.Empty);
-
///
/// Creates a mock LogicManagementClient
///
@@ -64,10 +54,7 @@ protected bool ValidateIdFormat(string id, string entityTypeName, string entityS
pattern += @"/[0-9a-z\-]*$";
- return Regex.IsMatch(
- input: id,
- pattern: pattern,
- options: RegexOptions.IgnoreCase);
+ return Regex.IsMatch(input: id, pattern: pattern, options: RegexOptions.IgnoreCase);
}
}
}
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountInMemoryTests.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccount.InMemoryTests.cs
similarity index 87%
rename from src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountInMemoryTests.cs
rename to src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccount.InMemoryTests.cs
index e7df06caf5310..dc194184db0a3 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountInMemoryTests.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccount.InMemoryTests.cs
@@ -17,24 +17,22 @@ namespace Test.Azure.Management.Logic
public class IntegrationAccountInMemoryTests : InMemoryTestsBase
{
+ private StringContent IntegrationAccountsList { get; set; }
+
+ private StringContent IntegrationAccount { get; set; }
+
+ private StringContent IntegrationAccountCallbackUrl { get; set; }
+
public IntegrationAccountInMemoryTests()
{
var content = File.ReadAllText(@"TestData/IntegrationAccountResponseContent.json");
var callbackUrlContent = File.ReadAllText(@"TestData/IntegrationAccountCallbackUrlResponseContent.json");
- this.IntegrationAccountsList =
- new StringContent(string.Format(Constants.ListFormat,
- content, Constants.NextPageLink));
+ this.IntegrationAccountsList = new StringContent(string.Format(Constants.ListFormat, content, Constants.NextPageLink));
this.IntegrationAccount = new StringContent(content);
this.IntegrationAccountCallbackUrl = new StringContent(callbackUrlContent);
}
- private StringContent IntegrationAccountsList { get; set; }
-
- private StringContent IntegrationAccount { get; set; }
-
- private StringContent IntegrationAccountCallbackUrl { get; set; }
-
[Fact]
public void IntegrationAccounts_ListBySubscription_Success()
{
@@ -123,7 +121,7 @@ public void IntegrationAccounts_ListByResourceGroup_Exception()
};
Assert.Throws(() => client.IntegrationAccounts.ListByResourceGroup(null));
- Assert.Throws(() => client.IntegrationAccounts.ListByResourceGroup(ResourceGroupName));
+ Assert.Throws(() => client.IntegrationAccounts.ListByResourceGroup(Constants.DefaultResourceGroup));
}
[Fact]
@@ -138,7 +136,7 @@ public void IntegrationAccounts_ListByResourceGroup_Success()
Content = this.IntegrationAccountsList
};
- var result = client.IntegrationAccounts.ListByResourceGroup(ResourceGroupName);
+ var result = client.IntegrationAccounts.ListByResourceGroup(Constants.DefaultResourceGroup);
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -199,9 +197,9 @@ public void IntegrationAccounts_CreateOrUpdate_Exception()
};
Assert.Throws(() => client.IntegrationAccounts.CreateOrUpdate(null, "IntegrationAccountName", new IntegrationAccount()));
- Assert.Throws(() => client.IntegrationAccounts.CreateOrUpdate(ResourceGroupName, null, new IntegrationAccount()));
- Assert.Throws(() => client.IntegrationAccounts.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.IntegrationAccounts.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", new IntegrationAccount()));
+ Assert.Throws(() => client.IntegrationAccounts.CreateOrUpdate(Constants.DefaultResourceGroup, null, new IntegrationAccount()));
+ Assert.Throws(() => client.IntegrationAccounts.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccounts.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", new IntegrationAccount()));
}
[Fact]
@@ -216,7 +214,7 @@ public void IntegrationAccounts_CreateOrUpdate_OK()
Content = this.IntegrationAccount
};
- var integrationAccount = client.IntegrationAccounts.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", new IntegrationAccount());
+ var integrationAccount = client.IntegrationAccounts.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", new IntegrationAccount());
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -238,7 +236,7 @@ public void IntegrationAccounts_CreateOrUpdate_Created()
Content = this.IntegrationAccount
};
- var integrationAccount = client.IntegrationAccounts.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", new IntegrationAccount());
+ var integrationAccount = client.IntegrationAccounts.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", new IntegrationAccount());
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -256,12 +254,13 @@ public void IntegrationAccounts_Delete_Exception()
handler.Response = new HttpResponseMessage
{
- StatusCode = HttpStatusCode.NotFound
+ StatusCode = HttpStatusCode.NotFound,
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.IntegrationAccounts.Delete(null, "IntegrationAccountName"));
- Assert.Throws(() => client.IntegrationAccounts.Delete(ResourceGroupName, null));
- Assert.Throws(() => client.IntegrationAccounts.Delete(ResourceGroupName, "IntegrationAccountName"));
+ Assert.Throws(() => client.IntegrationAccounts.Delete(Constants.DefaultResourceGroup, null));
+ Assert.Throws(() => client.IntegrationAccounts.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName"));
}
[Fact]
@@ -275,7 +274,7 @@ public void IntegrationAccounts_Delete_OK()
StatusCode = HttpStatusCode.OK
};
- client.IntegrationAccounts.Delete(ResourceGroupName, "IntegrationAccountName");
+ client.IntegrationAccounts.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -293,7 +292,7 @@ public void IntegrationAccounts_Delete_NoContent()
StatusCode = HttpStatusCode.NoContent
};
- client.IntegrationAccounts.Delete(ResourceGroupName, "IntegrationAccountName");
+ client.IntegrationAccounts.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -313,8 +312,8 @@ public void IntegrationAccounts_Get_Exception()
};
Assert.Throws(() => client.IntegrationAccounts.Get(null, "IntegrationAccountName"));
- Assert.Throws(() => client.IntegrationAccounts.Get(ResourceGroupName, null));
- Assert.Throws(() => client.IntegrationAccounts.Get(ResourceGroupName, "IntegrationAccountName"));
+ Assert.Throws(() => client.IntegrationAccounts.Get(Constants.DefaultResourceGroup, null));
+ Assert.Throws(() => client.IntegrationAccounts.Get(Constants.DefaultResourceGroup, "IntegrationAccountName"));
}
[Fact]
@@ -329,7 +328,7 @@ public void IntegrationAccounts_Get_OK()
Content = this.IntegrationAccount
};
- var result = client.IntegrationAccounts.Get(ResourceGroupName, "IntegrationAccountName");
+ var result = client.IntegrationAccounts.Get(Constants.DefaultResourceGroup, "IntegrationAccountName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -352,9 +351,9 @@ public void IntegrationAccounts_Update_Exception()
};
Assert.Throws(() => client.IntegrationAccounts.Update(null, "IntegrationAccountName", new IntegrationAccount()));
- Assert.Throws(() => client.IntegrationAccounts.Update(ResourceGroupName, null, new IntegrationAccount()));
- Assert.Throws(() => client.IntegrationAccounts.Update(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.IntegrationAccounts.Update(ResourceGroupName, "IntegrationAccountName", new IntegrationAccount()));
+ Assert.Throws(() => client.IntegrationAccounts.Update(Constants.DefaultResourceGroup, null, new IntegrationAccount()));
+ Assert.Throws(() => client.IntegrationAccounts.Update(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccounts.Update(Constants.DefaultResourceGroup, "IntegrationAccountName", new IntegrationAccount()));
}
[Fact]
@@ -374,7 +373,7 @@ public void IntegrationAccounts_Update_OK()
Tags = new Dictionary()
};
- integrationAccount = client.IntegrationAccounts.Update(ResourceGroupName, "IntegrationAccountName", integrationAccount);
+ integrationAccount = client.IntegrationAccounts.Update(Constants.DefaultResourceGroup, "IntegrationAccountName", integrationAccount);
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -397,9 +396,9 @@ public void IntegrationAccounts_ListCallbackUrl_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.IntegrationAccounts.GetCallbackUrl(null, "IntegrationAccountName", new GetCallbackUrlParameters()));
- Assert.Throws(() => client.IntegrationAccounts.GetCallbackUrl(ResourceGroupName, null, new GetCallbackUrlParameters()));
- Assert.Throws(() => client.IntegrationAccounts.GetCallbackUrl(ResourceGroupName, "IntegrationAccountName", new GetCallbackUrlParameters()));
+ Assert.Throws(() => client.IntegrationAccounts.ListCallbackUrl(null, "IntegrationAccountName", new GetCallbackUrlParameters()));
+ Assert.Throws(() => client.IntegrationAccounts.ListCallbackUrl(Constants.DefaultResourceGroup, null, new GetCallbackUrlParameters()));
+ Assert.Throws(() => client.IntegrationAccounts.ListCallbackUrl(Constants.DefaultResourceGroup, "IntegrationAccountName", new GetCallbackUrlParameters()));
}
[Fact]
@@ -414,20 +413,19 @@ public void IntegrationAccounts_ListCallbackUrl_OK()
Content = this.IntegrationAccountCallbackUrl
};
- var result = client.IntegrationAccounts.GetCallbackUrl(ResourceGroupName, "IntegrationAccountName", new GetCallbackUrlParameters());
+ var result = client.IntegrationAccounts.ListCallbackUrl(Constants.DefaultResourceGroup, "IntegrationAccountName", new GetCallbackUrlParameters());
// Validates request.
handler.Request.ValidateAuthorizationHeader();
handler.Request.ValidateMethod(HttpMethod.Post);
- Assert.NotNull(result.Value);
// Validates result.
-
+ Assert.NotNull(result.Value);
}
private void ValidateIntegrationAccountList(IPage result)
{
- Assert.Equal(1, result.Count());
+ Assert.Single(result);
this.ValidateIntegrationAccount(result.First());
Assert.Equal(Constants.NextPageLink, result.NextPageLink);
}
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountAgreementInMemoryTests.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountAgreement.InMemoryTests.cs
similarity index 60%
rename from src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountAgreementInMemoryTests.cs
rename to src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountAgreement.InMemoryTests.cs
index 8cf42270b08a6..573f95e74d6c9 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountAgreementInMemoryTests.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountAgreement.InMemoryTests.cs
@@ -16,21 +16,20 @@ namespace Test.Azure.Management.Logic
public class IntegrationAccountAgreementInMemoryTests : InMemoryTestsBase
{
+ private StringContent AgreementList { get; set; }
+
+ private StringContent Agreement { get; set; }
+
public IntegrationAccountAgreementInMemoryTests()
{
var content = File.ReadAllText(@"TestData/IntegrationAccountAgreementResponseContent.json");
- this.AgreementList = new StringContent(string.Format(Constants.ListFormat,
- content, Constants.NextPageLink));
+ this.AgreementList = new StringContent(string.Format(Constants.ListFormat, content, Constants.NextPageLink));
this.Agreement = new StringContent(content);
}
- private StringContent AgreementList { get; set; }
-
- private StringContent Agreement { get; set; }
-
[Fact]
- public void IntegrationAccountAgreement_ListByResourceGroup_Exception()
+ public void IntegrationAccountAgreement_List_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -41,12 +40,12 @@ public void IntegrationAccountAgreement_ListByResourceGroup_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Agreements.ListByIntegrationAccounts(null, "IntegrationAccount"));
- Assert.Throws(() => client.Agreements.ListByIntegrationAccounts(ResourceGroupName, "IntegrationAccount"));
+ Assert.Throws(() => client.IntegrationAccountAgreements.List(null, "IntegrationAccount"));
+ Assert.Throws(() => client.IntegrationAccountAgreements.List(Constants.DefaultResourceGroup, "IntegrationAccount"));
}
[Fact]
- public void IntegrationAccountAgreement_ListByResourceGroup_Success()
+ public void IntegrationAccountAgreement_List_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -57,7 +56,7 @@ public void IntegrationAccountAgreement_ListByResourceGroup_Success()
Content = this.AgreementList
};
- var result = client.Agreements.ListByIntegrationAccounts(ResourceGroupName, "IntegrationAccount");
+ var result = client.IntegrationAccountAgreements.List(Constants.DefaultResourceGroup, "IntegrationAccount");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -68,7 +67,7 @@ public void IntegrationAccountAgreement_ListByResourceGroup_Success()
}
[Fact]
- public void IntegrationAccountAgreement_ListByResourceGroupNext_Exception()
+ public void IntegrationAccountAgreement_ListNext_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -79,12 +78,12 @@ public void IntegrationAccountAgreement_ListByResourceGroupNext_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Agreements.ListByIntegrationAccountsNext(null));
- Assert.Throws(() => client.Agreements.ListByIntegrationAccountsNext(Constants.NextPageLink));
+ Assert.Throws(() => client.IntegrationAccountAgreements.ListNext(null));
+ Assert.Throws(() => client.IntegrationAccountAgreements.ListNext(Constants.NextPageLink));
}
[Fact]
- public void IntegrationAccountAgreement_ListByResourceGroupNext_Success()
+ public void IntegrationAccountAgreement_ListNext_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -95,7 +94,7 @@ public void IntegrationAccountAgreement_ListByResourceGroupNext_Success()
Content = this.AgreementList
};
- var result = client.Agreements.ListByIntegrationAccountsNext(Constants.NextPageLink);
+ var result = client.IntegrationAccountAgreements.ListNext(Constants.NextPageLink);
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -117,12 +116,18 @@ public void IntegrationAccountAgreement_CreateOrUpdate_Exception()
Content = new StringContent(string.Empty)
};
- var agreeement = new IntegrationAccountAgreement(AgreementType.Edifact, "hostPartner", "guestPartner", new BusinessIdentity("a", "b"), new BusinessIdentity("a", "b"), new AgreementContent());
- Assert.Throws(() => client.Agreements.CreateOrUpdate(null, "IntegrationAccountName", "AgreementName", new IntegrationAccountAgreement()));
- Assert.Throws(() => client.Agreements.CreateOrUpdate(ResourceGroupName, null, "AgreementName", new IntegrationAccountAgreement()));
- Assert.Throws(() => client.Agreements.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", null, new IntegrationAccountAgreement()));
- Assert.Throws(() => client.Agreements.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "AgreementName", null));
- Assert.Throws(() => client.Agreements.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "AgreementName", agreeement));
+ var agreeement = new IntegrationAccountAgreement(AgreementType.Edifact,
+ "hostPartner",
+ "guestPartner",
+ new BusinessIdentity("a", "b"),
+ new BusinessIdentity("a", "b"),
+ new AgreementContent());
+
+ Assert.Throws(() => client.IntegrationAccountAgreements.CreateOrUpdate(null, "IntegrationAccountName", "AgreementName", new IntegrationAccountAgreement()));
+ Assert.Throws(() => client.IntegrationAccountAgreements.CreateOrUpdate(Constants.DefaultResourceGroup, null, "AgreementName", new IntegrationAccountAgreement()));
+ Assert.Throws(() => client.IntegrationAccountAgreements.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", null, new IntegrationAccountAgreement()));
+ Assert.Throws(() => client.IntegrationAccountAgreements.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "AgreementName", null));
+ Assert.Throws(() => client.IntegrationAccountAgreements.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "AgreementName", agreeement));
}
[Fact]
@@ -137,7 +142,15 @@ public void IntegrationAccountAgreement_CreateOrUpdate_OK()
Content = this.Agreement
};
- var result = client.Agreements.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "AgreementName", new IntegrationAccountAgreement(AgreementType.Edifact, "hostPartner", "guestPartner", new BusinessIdentity("a", "b"), new BusinessIdentity("a", "b"), new AgreementContent()));
+ var result = client.IntegrationAccountAgreements.CreateOrUpdate(Constants.DefaultResourceGroup,
+ "IntegrationAccountName",
+ "AgreementName",
+ new IntegrationAccountAgreement(AgreementType.Edifact,
+ "hostPartner",
+ "guestPartner",
+ new BusinessIdentity("a", "b"),
+ new BusinessIdentity("a", "b"),
+ new AgreementContent()));
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -159,7 +172,15 @@ public void IntegrationAccountAgreement_CreateOrUpdate_Created()
Content = this.Agreement
};
- var result = client.Agreements.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "AgreementName", new IntegrationAccountAgreement(AgreementType.Edifact,"hostPartner", "guestPartner", new BusinessIdentity("a","b"),new BusinessIdentity("a","b"),new AgreementContent()));
+ var result = client.IntegrationAccountAgreements.CreateOrUpdate(Constants.DefaultResourceGroup,
+ "IntegrationAccountName",
+ "AgreementName",
+ new IntegrationAccountAgreement(AgreementType.Edifact,
+ "hostPartner",
+ "guestPartner",
+ new BusinessIdentity("a", "b"),
+ new BusinessIdentity("a", "b"),
+ new AgreementContent()));
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -177,13 +198,14 @@ public void IntegrationAccountAgreement_Delete_Exception()
handler.Response = new HttpResponseMessage
{
- StatusCode = HttpStatusCode.NotFound
+ StatusCode = HttpStatusCode.NotFound,
+ Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Agreements.Delete(null, "IntegrationAccountName", "AgreementName"));
- Assert.Throws(() => client.Agreements.Delete(ResourceGroupName, null, "AgreementName"));
- Assert.Throws(() => client.Agreements.Delete(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.Agreements.Delete(ResourceGroupName, "IntegrationAccountName", "AgreementName"));
+ Assert.Throws(() => client.IntegrationAccountAgreements.Delete(null, "IntegrationAccountName", "AgreementName"));
+ Assert.Throws(() => client.IntegrationAccountAgreements.Delete(Constants.DefaultResourceGroup, null, "AgreementName"));
+ Assert.Throws(() => client.IntegrationAccountAgreements.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccountAgreements.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "AgreementName"));
}
[Fact]
@@ -197,7 +219,7 @@ public void IntegrationAccountAgreement_Delete_OK()
StatusCode = HttpStatusCode.OK
};
- client.Agreements.Delete(ResourceGroupName, "IntegrationAccountName", "AgreementName");
+ client.IntegrationAccountAgreements.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "AgreementName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -215,7 +237,7 @@ public void IntegrationAccountAgreement_Delete_NoContent()
StatusCode = HttpStatusCode.NoContent
};
- client.Agreements.Delete(ResourceGroupName, "IntegrationAccountName", "AgreementName");
+ client.IntegrationAccountAgreements.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "AgreementName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -234,10 +256,10 @@ public void IntegrationAccountAgreement_Get_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Agreements.Get(null, "IntegrationAccountName", "AgreementName"));
- Assert.Throws(() => client.Agreements.Get(ResourceGroupName, null, "AgreementName"));
- Assert.Throws(() => client.Agreements.Get(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.Agreements.Get(ResourceGroupName, "IntegrationAccountName", "AgreementName"));
+ Assert.Throws(() => client.IntegrationAccountAgreements.Get(null, "IntegrationAccountName", "AgreementName"));
+ Assert.Throws(() => client.IntegrationAccountAgreements.Get(Constants.DefaultResourceGroup, null, "AgreementName"));
+ Assert.Throws(() => client.IntegrationAccountAgreements.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccountAgreements.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", "AgreementName"));
}
[Fact]
@@ -252,7 +274,7 @@ public void IntegrationAccountAgreement_Get_OK()
Content = this.Agreement
};
- var result = client.Agreements.Get(ResourceGroupName, "IntegrationAccountName", "AgreementName");
+ var result = client.IntegrationAccountAgreements.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", "AgreementName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -264,7 +286,7 @@ public void IntegrationAccountAgreement_Get_OK()
private void ValidateAgreementList(IPage result)
{
- Assert.Equal(1, result.Count());
+ Assert.Single(result);
this.ValidateAgreement(result.First());
Assert.Equal(Constants.NextPageLink, result.NextPageLink);
}
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountCertificateInMemoryTests.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountCertificate.InMemoryTests.cs
similarity index 67%
rename from src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountCertificateInMemoryTests.cs
rename to src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountCertificate.InMemoryTests.cs
index c0f9ca5f1f78f..9008fef52bce4 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountCertificateInMemoryTests.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountCertificate.InMemoryTests.cs
@@ -17,21 +17,20 @@ namespace Test.Azure.Management.Logic
public class IntegrationAccountCertificateInMemoryTests : InMemoryTestsBase
{
+ private StringContent CertificateList { get; set; }
+
+ private StringContent Certificate { get; set; }
+
public IntegrationAccountCertificateInMemoryTests()
{
var content = File.ReadAllText(@"TestData/IntegrationAccountCertificateResponseContent.json");
- this.CertificateList = new StringContent(string.Format(Constants.ListFormat,
- content, Constants.NextPageLink));
+ this.CertificateList = new StringContent(string.Format(Constants.ListFormat, content, Constants.NextPageLink));
this.Certificate = new StringContent(content);
}
- private StringContent CertificateList { get; set; }
-
- private StringContent Certificate { get; set; }
-
[Fact]
- public void IntegrationAccountCertificate_ListByResourceGroup_Exception()
+ public void IntegrationAccountCertificate_List_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -42,13 +41,12 @@ public void IntegrationAccountCertificate_ListByResourceGroup_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(
- () => client.Certificates.ListByIntegrationAccounts(null, "IntegrationAccount",null));
- Assert.Throws(() => client.Certificates.ListByIntegrationAccounts(ResourceGroupName, "IntegrationAccount"));
+ Assert.Throws(() => client.IntegrationAccountCertificates.List(null, "IntegrationAccount",null));
+ Assert.Throws(() => client.IntegrationAccountCertificates.List(Constants.DefaultResourceGroup, "IntegrationAccount"));
}
[Fact]
- public void IntegrationAccountCertificate_ListByResourceGroup_Success()
+ public void IntegrationAccountCertificate_List_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -59,7 +57,7 @@ public void IntegrationAccountCertificate_ListByResourceGroup_Success()
Content = this.CertificateList
};
- var result = client.Certificates.ListByIntegrationAccounts(ResourceGroupName, "IntegrationAccount");
+ var result = client.IntegrationAccountCertificates.List(Constants.DefaultResourceGroup, "IntegrationAccount");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -70,7 +68,7 @@ public void IntegrationAccountCertificate_ListByResourceGroup_Success()
}
[Fact]
- public void IntegrationAccountCertificate_ListByResourceGroupNext_Exception()
+ public void IntegrationAccountCertificate_ListNext_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -81,12 +79,12 @@ public void IntegrationAccountCertificate_ListByResourceGroupNext_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Certificates.ListByIntegrationAccountsNext(null));
- Assert.Throws(() => client.Certificates.ListByIntegrationAccountsNext(Constants.NextPageLink));
+ Assert.Throws(() => client.IntegrationAccountCertificates.ListNext(null));
+ Assert.Throws(() => client.IntegrationAccountCertificates.ListNext(Constants.NextPageLink));
}
[Fact]
- public void IntegrationAccountCertificate_ListByResourceGroupNext_Success()
+ public void IntegrationAccountCertificate_ListNext_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -97,7 +95,7 @@ public void IntegrationAccountCertificate_ListByResourceGroupNext_Success()
Content = this.CertificateList
};
- var result = client.Certificates.ListByIntegrationAccountsNext(Constants.NextPageLink);
+ var result = client.IntegrationAccountCertificates.ListNext(Constants.NextPageLink);
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -119,11 +117,11 @@ public void IntegrationAccountCertificate_CreateOrUpdate_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Certificates.CreateOrUpdate(null, "IntegrationAccountName", "IntegrationAccountCertificate", new IntegrationAccountCertificate()));
- Assert.Throws(() => client.Certificates.CreateOrUpdate(ResourceGroupName, null, "IntegrationAccountCertificate", new IntegrationAccountCertificate()));
- Assert.Throws(() => client.Certificates.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", null, new IntegrationAccountCertificate()));
- Assert.Throws(() => client.Certificates.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "IntegrationAccountCertificate", null));
- Assert.Throws(() => client.Certificates.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "IntegrationAccountCertificate", new IntegrationAccountCertificate()));
+ Assert.Throws(() => client.IntegrationAccountCertificates.CreateOrUpdate(null, "IntegrationAccountName", "IntegrationAccountCertificate", new IntegrationAccountCertificate()));
+ Assert.Throws(() => client.IntegrationAccountCertificates.CreateOrUpdate(Constants.DefaultResourceGroup, null, "IntegrationAccountCertificate", new IntegrationAccountCertificate()));
+ Assert.Throws(() => client.IntegrationAccountCertificates.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", null, new IntegrationAccountCertificate()));
+ Assert.Throws(() => client.IntegrationAccountCertificates.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "IntegrationAccountCertificate", null));
+ Assert.Throws(() => client.IntegrationAccountCertificates.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "IntegrationAccountCertificate", new IntegrationAccountCertificate()));
}
[Fact]
@@ -138,7 +136,7 @@ public void IntegrationAccountCertificate_CreateOrUpdate_OK()
Content = this.Certificate
};
- var result = client.Certificates.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "IntegrationAccountCertificate", new IntegrationAccountCertificate());
+ var result = client.IntegrationAccountCertificates.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "IntegrationAccountCertificate", new IntegrationAccountCertificate());
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -160,7 +158,7 @@ public void IntegrationAccountCertificate_CreateOrUpdate_Created()
Content = this.Certificate
};
- var result = client.Certificates.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "IntegrationAccountCertificate", new IntegrationAccountCertificate());
+ var result = client.IntegrationAccountCertificates.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "IntegrationAccountCertificate", new IntegrationAccountCertificate());
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -178,13 +176,14 @@ public void IntegrationAccountCertificate_Delete_Exception()
handler.Response = new HttpResponseMessage
{
- StatusCode = HttpStatusCode.NotFound
+ StatusCode = HttpStatusCode.NotFound,
+ Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Certificates.Delete(null, "IntegrationAccountName", "IntegrationAccountCertificate"));
- Assert.Throws(() => client.Certificates.Delete(ResourceGroupName, null, "IntegrationAccountCertificate"));
- Assert.Throws(() => client.Certificates.Delete(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.Certificates.Delete(ResourceGroupName, "IntegrationAccountName", "IntegrationAccountCertificate"));
+ Assert.Throws(() => client.IntegrationAccountCertificates.Delete(null, "IntegrationAccountName", "IntegrationAccountCertificate"));
+ Assert.Throws(() => client.IntegrationAccountCertificates.Delete(Constants.DefaultResourceGroup, null, "IntegrationAccountCertificate"));
+ Assert.Throws(() => client.IntegrationAccountCertificates.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccountCertificates.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "IntegrationAccountCertificate"));
}
[Fact]
@@ -198,7 +197,7 @@ public void IntegrationAccountCertificate_Delete_OK()
StatusCode = HttpStatusCode.OK
};
- client.Certificates.Delete(ResourceGroupName, "IntegrationAccountName", "IntegrationAccountCertificate");
+ client.IntegrationAccountCertificates.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "IntegrationAccountCertificate");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -216,7 +215,7 @@ public void IntegrationAccountCertificate_Delete_NoContent()
StatusCode = HttpStatusCode.NoContent
};
- client.Certificates.Delete(ResourceGroupName, "IntegrationAccountName", "IntegrationAccountCertificate");
+ client.IntegrationAccountCertificates.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "IntegrationAccountCertificate");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -235,10 +234,10 @@ public void IntegrationAccountCertificate_Get_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Certificates.Get(null, "IntegrationAccountName", "IntegrationAccountCertificate"));
- Assert.Throws(() => client.Certificates.Get(ResourceGroupName, null, "IntegrationAccountCertificate"));
- Assert.Throws(() => client.Certificates.Get(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.Certificates.Get(ResourceGroupName, "IntegrationAccountName", "IntegrationAccountCertificate"));
+ Assert.Throws(() => client.IntegrationAccountCertificates.Get(null, "IntegrationAccountName", "IntegrationAccountCertificate"));
+ Assert.Throws(() => client.IntegrationAccountCertificates.Get(Constants.DefaultResourceGroup, null, "IntegrationAccountCertificate"));
+ Assert.Throws(() => client.IntegrationAccountCertificates.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccountCertificates.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", "IntegrationAccountCertificate"));
}
[Fact]
@@ -253,7 +252,7 @@ public void IntegrationAccountCertificate_Get_OK()
Content = this.Certificate
};
- var result = client.Certificates.Get(ResourceGroupName, "IntegrationAccountName", "IntegrationAccountCertificate");
+ var result = client.IntegrationAccountCertificates.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", "IntegrationAccountCertificate");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -265,7 +264,7 @@ public void IntegrationAccountCertificate_Get_OK()
private void ValidateCertificateList(IPage result)
{
- Assert.Equal(1, result.Count());
+ Assert.Single(result);
this.ValidateCertificate(result.First());
Assert.Equal(Constants.NextPageLink, result.NextPageLink);
}
@@ -299,7 +298,6 @@ private void ValidateCertificate(IntegrationAccountCertificate certificate)
Assert.Equal(11, certificate.ChangedTime.Value.Minute);
Assert.Equal(08, certificate.ChangedTime.Value.Second);
Assert.Equal(DateTimeKind.Utc, certificate.ChangedTime.Value.Kind);
-
}
}
}
\ No newline at end of file
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountMapInMemoryTests.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountMap.InMemoryTests.cs
similarity index 69%
rename from src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountMapInMemoryTests.cs
rename to src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountMap.InMemoryTests.cs
index 55076e6e3fd57..52eff72034531 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountMapInMemoryTests.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountMap.InMemoryTests.cs
@@ -17,21 +17,20 @@ namespace Test.Azure.Management.Logic
public class IntegrationAccountMapInMemoryTests : InMemoryTestsBase
{
+ private StringContent MapList { get; set; }
+
+ private StringContent Map { get; set; }
+
public IntegrationAccountMapInMemoryTests()
{
var content = File.ReadAllText(@"TestData/IntegrationAccountMapResponseContent.json");
- this.MapList = new StringContent(string.Format(Constants.ListFormat,
- content, Constants.NextPageLink));
+ this.MapList = new StringContent(string.Format(Constants.ListFormat, content, Constants.NextPageLink));
this.Map = new StringContent(content);
}
- private StringContent MapList { get; set; }
-
- private StringContent Map { get; set; }
-
[Fact]
- public void IntegrationAccountMap_ListByResourceGroup_Exception()
+ public void IntegrationAccountMap_List_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -42,13 +41,12 @@ public void IntegrationAccountMap_ListByResourceGroup_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(
- () => client.Maps.ListByIntegrationAccounts(null, "IntegrationAccount",null));
- Assert.Throws(() => client.Maps.ListByIntegrationAccounts(ResourceGroupName, "IntegrationAccount"));
+ Assert.Throws(() => client.IntegrationAccountMaps.List(null, "IntegrationAccount",null));
+ Assert.Throws(() => client.IntegrationAccountMaps.List(Constants.DefaultResourceGroup, "IntegrationAccount"));
}
[Fact]
- public void IntegrationAccountMap_ListByResourceGroup_Success()
+ public void IntegrationAccountMap_List_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -59,7 +57,7 @@ public void IntegrationAccountMap_ListByResourceGroup_Success()
Content = this.MapList
};
- var result = client.Maps.ListByIntegrationAccounts(ResourceGroupName, "IntegrationAccount");
+ var result = client.IntegrationAccountMaps.List(Constants.DefaultResourceGroup, "IntegrationAccount");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -70,7 +68,7 @@ public void IntegrationAccountMap_ListByResourceGroup_Success()
}
[Fact]
- public void IntegrationAccountMap_ListByResourceGroupNext_Exception()
+ public void IntegrationAccountMap_ListNext_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -81,12 +79,12 @@ public void IntegrationAccountMap_ListByResourceGroupNext_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Maps.ListByIntegrationAccountsNext(null));
- Assert.Throws(() => client.Maps.ListByIntegrationAccountsNext(Constants.NextPageLink));
+ Assert.Throws(() => client.IntegrationAccountMaps.ListNext(null));
+ Assert.Throws(() => client.IntegrationAccountMaps.ListNext(Constants.NextPageLink));
}
[Fact]
- public void IntegrationAccountMap_ListByResourceGroupNext_Success()
+ public void IntegrationAccountMap_ListNext_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -97,7 +95,7 @@ public void IntegrationAccountMap_ListByResourceGroupNext_Success()
Content = this.MapList
};
- var result = client.Maps.ListByIntegrationAccountsNext(Constants.NextPageLink);
+ var result = client.IntegrationAccountMaps.ListNext(Constants.NextPageLink);
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -119,11 +117,11 @@ public void IntegrationAccountMap_CreateOrUpdate_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Maps.CreateOrUpdate(null, "IntegrationAccountName", "MapName", new IntegrationAccountMap()));
- Assert.Throws(() => client.Maps.CreateOrUpdate(ResourceGroupName, null, "MapName", new IntegrationAccountMap()));
- Assert.Throws(() => client.Maps.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", null, new IntegrationAccountMap()));
- Assert.Throws(() => client.Maps.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "MapName", null));
- Assert.Throws(() => client.Maps.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "MapName", new IntegrationAccountMap()));
+ Assert.Throws(() => client.IntegrationAccountMaps.CreateOrUpdate(null, "IntegrationAccountName", "MapName", new IntegrationAccountMap(MapType.Xslt)));
+ Assert.Throws(() => client.IntegrationAccountMaps.CreateOrUpdate(Constants.DefaultResourceGroup, null, "MapName", new IntegrationAccountMap(MapType.Xslt)));
+ Assert.Throws(() => client.IntegrationAccountMaps.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", null, new IntegrationAccountMap(MapType.Xslt)));
+ Assert.Throws(() => client.IntegrationAccountMaps.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "MapName", null));
+ Assert.Throws(() => client.IntegrationAccountMaps.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "MapName", new IntegrationAccountMap(MapType.Xslt)));
}
[Fact]
@@ -138,7 +136,7 @@ public void IntegrationAccountMap_CreateOrUpdate_OK()
Content = this.Map
};
- var map = client.Maps.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "MapName", new IntegrationAccountMap());
+ var map = client.IntegrationAccountMaps.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "MapName", new IntegrationAccountMap(MapType.Xslt));
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -160,7 +158,7 @@ public void IntegrationAccountMap_CreateOrUpdate_Created()
Content = this.Map
};
- var map = client.Maps.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "MapName", new IntegrationAccountMap());
+ var map = client.IntegrationAccountMaps.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "MapName", new IntegrationAccountMap(MapType.Xslt));
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -178,13 +176,14 @@ public void IntegrationAccountMap_Delete_Exception()
handler.Response = new HttpResponseMessage
{
- StatusCode = HttpStatusCode.NotFound
+ StatusCode = HttpStatusCode.NotFound,
+ Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Maps.Delete(null, "IntegrationAccountName","MapName"));
- Assert.Throws(() => client.Maps.Delete(ResourceGroupName, null, "MapName"));
- Assert.Throws(() => client.Maps.Delete(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.Maps.Delete(ResourceGroupName, "IntegrationAccountName", "MapName"));
+ Assert.Throws(() => client.IntegrationAccountMaps.Delete(null, "IntegrationAccountName","MapName"));
+ Assert.Throws(() => client.IntegrationAccountMaps.Delete(Constants.DefaultResourceGroup, null, "MapName"));
+ Assert.Throws(() => client.IntegrationAccountMaps.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccountMaps.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "MapName"));
}
[Fact]
@@ -198,7 +197,7 @@ public void IntegrationAccountMap_Delete_OK()
StatusCode = HttpStatusCode.OK
};
- client.Maps.Delete(ResourceGroupName, "IntegrationAccountName", "MapName");
+ client.IntegrationAccountMaps.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "MapName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -216,7 +215,7 @@ public void IntegrationAccountMap_Delete_NoContent()
StatusCode = HttpStatusCode.NoContent
};
- client.Maps.Delete(ResourceGroupName, "IntegrationAccountName","MapName");
+ client.IntegrationAccountMaps.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName","MapName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -235,10 +234,10 @@ public void IntegrationAccountMap_Get_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Maps.Get(null, "IntegrationAccountName", "MapName"));
- Assert.Throws(() => client.Maps.Get(ResourceGroupName, null, "MapName"));
- Assert.Throws(() => client.Maps.Get(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.Maps.Get(ResourceGroupName, "IntegrationAccountName", "MapName"));
+ Assert.Throws(() => client.IntegrationAccountMaps.Get(null, "IntegrationAccountName", "MapName"));
+ Assert.Throws(() => client.IntegrationAccountMaps.Get(Constants.DefaultResourceGroup, null, "MapName"));
+ Assert.Throws(() => client.IntegrationAccountMaps.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccountMaps.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", "MapName"));
}
[Fact]
@@ -253,7 +252,7 @@ public void IntegrationAccountMap_Get_OK()
Content = this.Map
};
- var result = client.Maps.Get(ResourceGroupName, "IntegrationAccountName", "MapName");
+ var result = client.IntegrationAccountMaps.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", "MapName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -265,7 +264,7 @@ public void IntegrationAccountMap_Get_OK()
private void ValidateMapList(IPage result)
{
- Assert.Equal(1, result.Count());
+ Assert.Single(result);
this.ValidateMap(result.First());
Assert.Equal(Constants.NextPageLink, result.NextPageLink);
}
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountPartnerInMemoryTests.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountPartner.InMemoryTests.cs
similarity index 67%
rename from src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountPartnerInMemoryTests.cs
rename to src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountPartner.InMemoryTests.cs
index 6f847358c6394..ddb7e72125f56 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountPartnerInMemoryTests.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountPartner.InMemoryTests.cs
@@ -17,21 +17,20 @@ namespace Test.Azure.Management.Logic
public class IntegrationAccountPartnerInMemoryTests : InMemoryTestsBase
{
+ private StringContent PartnerList { get; set; }
+
+ private StringContent Partner { get; set; }
+
public IntegrationAccountPartnerInMemoryTests()
{
var content = File.ReadAllText(@"TestData/IntegrationAccountPartnerResponseContent.json");
- this.PartnerList = new StringContent(string.Format(Constants.ListFormat,
- content, Constants.NextPageLink));
+ this.PartnerList = new StringContent(string.Format(Constants.ListFormat, content, Constants.NextPageLink));
this.Partner = new StringContent(content);
}
- private StringContent PartnerList { get; set; }
-
- private StringContent Partner { get; set; }
-
[Fact]
- public void IntegrationAccountPartner_ListByResourceGroup_Exception()
+ public void IntegrationAccountPartner_List_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -42,13 +41,12 @@ public void IntegrationAccountPartner_ListByResourceGroup_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(
- () => client.Partners.ListByIntegrationAccounts(null, "IntegrationAccount"));
- Assert.Throws(() => client.Maps.ListByIntegrationAccounts(ResourceGroupName, "IntegrationAccount"));
+ Assert.Throws(() => client.IntegrationAccountPartners.List(null, "IntegrationAccount"));
+ Assert.Throws(() => client.IntegrationAccountMaps.List(Constants.DefaultResourceGroup, "IntegrationAccount"));
}
[Fact]
- public void IntegrationAccountPartner_ListByResourceGroup_Success()
+ public void IntegrationAccountPartner_List_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -59,7 +57,7 @@ public void IntegrationAccountPartner_ListByResourceGroup_Success()
Content = this.PartnerList
};
- var result = client.Partners.ListByIntegrationAccounts(ResourceGroupName, "IntegrationAccount");
+ var result = client.IntegrationAccountPartners.List(Constants.DefaultResourceGroup, "IntegrationAccount");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -70,7 +68,7 @@ public void IntegrationAccountPartner_ListByResourceGroup_Success()
}
[Fact]
- public void IntegrationAccountPartner_ListByResourceGroupNext_Exception()
+ public void IntegrationAccountPartner_ListNext_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -81,12 +79,12 @@ public void IntegrationAccountPartner_ListByResourceGroupNext_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Partners.ListByIntegrationAccountsNext(null));
- Assert.Throws(() => client.Partners.ListByIntegrationAccountsNext(Constants.NextPageLink));
+ Assert.Throws(() => client.IntegrationAccountPartners.ListNext(null));
+ Assert.Throws(() => client.IntegrationAccountPartners.ListNext(Constants.NextPageLink));
}
[Fact]
- public void IntegrationAccountPartner_ListByResourceGroupNext_Success()
+ public void IntegrationAccountPartner_ListNext_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -97,7 +95,7 @@ public void IntegrationAccountPartner_ListByResourceGroupNext_Success()
Content = this.PartnerList
};
- var result = client.Partners.ListByIntegrationAccountsNext(Constants.NextPageLink);
+ var result = client.IntegrationAccountPartners.ListNext(Constants.NextPageLink);
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -119,11 +117,11 @@ public void IntegrationAccountPartner_CreateOrUpdate_Exception()
Content = new StringContent("Test")
};
- Assert.Throws(() => client.Partners.CreateOrUpdate(null, "IntegrationAccountName", "PartnerName", new IntegrationAccountPartner()));
- Assert.Throws(() => client.Partners.CreateOrUpdate(ResourceGroupName, null, "PartnerName", new IntegrationAccountPartner()));
- Assert.Throws(() => client.Partners.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", null, new IntegrationAccountPartner()));
- Assert.Throws(() => client.Partners.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "PartnerName", null));
- Assert.Throws(() => client.Partners.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "PartnerName", new IntegrationAccountPartner(PartnerType.B2B, new PartnerContent())));
+ Assert.Throws(() => client.IntegrationAccountPartners.CreateOrUpdate(null, "IntegrationAccountName", "PartnerName", new IntegrationAccountPartner()));
+ Assert.Throws(() => client.IntegrationAccountPartners.CreateOrUpdate(Constants.DefaultResourceGroup, null, "PartnerName", new IntegrationAccountPartner()));
+ Assert.Throws(() => client.IntegrationAccountPartners.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", null, new IntegrationAccountPartner()));
+ Assert.Throws(() => client.IntegrationAccountPartners.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "PartnerName", null));
+ Assert.Throws(() => client.IntegrationAccountPartners.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "PartnerName", new IntegrationAccountPartner(PartnerType.B2B, new PartnerContent())));
}
[Fact]
@@ -138,7 +136,7 @@ public void IntegrationAccountPartner_CreateOrUpdate_OK()
Content = this.Partner
};
- var result = client.Partners.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "PartnerName", new IntegrationAccountPartner(PartnerType.B2B, new PartnerContent()));
+ var result = client.IntegrationAccountPartners.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "PartnerName", new IntegrationAccountPartner(PartnerType.B2B, new PartnerContent()));
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -160,7 +158,7 @@ public void IntegrationAccountPartner_CreateOrUpdate_Created()
Content = this.Partner
};
- var result = client.Partners.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "PartnerName", new IntegrationAccountPartner(PartnerType.B2B, new PartnerContent()));
+ var result = client.IntegrationAccountPartners.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "PartnerName", new IntegrationAccountPartner(PartnerType.B2B, new PartnerContent()));
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -178,13 +176,14 @@ public void IntegrationAccountPartner_Delete_Exception()
handler.Response = new HttpResponseMessage
{
- StatusCode = HttpStatusCode.NotFound
+ StatusCode = HttpStatusCode.NotFound,
+ Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Partners.Delete(null, "IntegrationAccountName", "PartnerName"));
- Assert.Throws(() => client.Partners.Delete(ResourceGroupName, null, "PartnerName"));
- Assert.Throws(() => client.Partners.Delete(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.Partners.Delete(ResourceGroupName, "IntegrationAccountName", "PartnerName"));
+ Assert.Throws(() => client.IntegrationAccountPartners.Delete(null, "IntegrationAccountName", "PartnerName"));
+ Assert.Throws(() => client.IntegrationAccountPartners.Delete(Constants.DefaultResourceGroup, null, "PartnerName"));
+ Assert.Throws(() => client.IntegrationAccountPartners.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccountPartners.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "PartnerName"));
}
[Fact]
@@ -198,7 +197,7 @@ public void IntegrationAccountPartner_Delete_OK()
StatusCode = HttpStatusCode.OK
};
- client.Partners.Delete(ResourceGroupName, "IntegrationAccountName", "PartnerName");
+ client.IntegrationAccountPartners.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "PartnerName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -216,7 +215,7 @@ public void IntegrationAccountPartner_Delete_NoContent()
StatusCode = HttpStatusCode.NoContent
};
- client.Partners.Delete(ResourceGroupName, "IntegrationAccountName", "PartnerName");
+ client.IntegrationAccountPartners.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "PartnerName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -235,10 +234,10 @@ public void IntegrationAccountPartner_Get_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Partners.Get(null, "IntegrationAccountName", "PartnerName"));
- Assert.Throws(() => client.Partners.Get(ResourceGroupName, null, "PartnerName"));
- Assert.Throws(() => client.Partners.Get(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.Partners.Get(ResourceGroupName, "IntegrationAccountName", "PartnerName"));
+ Assert.Throws(() => client.IntegrationAccountPartners.Get(null, "IntegrationAccountName", "PartnerName"));
+ Assert.Throws(() => client.IntegrationAccountPartners.Get(Constants.DefaultResourceGroup, null, "PartnerName"));
+ Assert.Throws(() => client.IntegrationAccountPartners.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccountPartners.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", "PartnerName"));
}
[Fact]
@@ -253,7 +252,7 @@ public void IntegrationAccountPartner_Get_OK()
Content = this.Partner
};
- var result = client.Partners.Get(ResourceGroupName, "IntegrationAccountName", "PartnerName");
+ var result = client.IntegrationAccountPartners.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", "PartnerName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -265,7 +264,7 @@ public void IntegrationAccountPartner_Get_OK()
private void ValidatePartnerList(IPage result)
{
- Assert.Equal(1, result.Count());
+ Assert.Single(result);
this.ValidatePartner(result.First());
Assert.Equal(Constants.NextPageLink, result.NextPageLink);
}
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSchemaInMemoryTests.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSchema.InMemoryTests.cs
similarity index 69%
rename from src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSchemaInMemoryTests.cs
rename to src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSchema.InMemoryTests.cs
index 5f70011f62e62..2b3d27e7adb2b 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSchemaInMemoryTests.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSchema.InMemoryTests.cs
@@ -17,21 +17,20 @@ namespace Test.Azure.Management.Logic
public class IntegrationAccountSchemaInMemoryTests : InMemoryTestsBase
{
+ private StringContent SchemaList { get; set; }
+
+ private StringContent Schema { get; set; }
+
public IntegrationAccountSchemaInMemoryTests()
{
var content = File.ReadAllText(@"TestData/IntegrationAccountSchemaResponseContent.json");
- this.SchemaList = new StringContent(string.Format(Constants.ListFormat,
- content, Constants.NextPageLink));
+ this.SchemaList = new StringContent(string.Format(Constants.ListFormat, content, Constants.NextPageLink));
this.Schema = new StringContent(content);
}
- private StringContent SchemaList { get; set; }
-
- private StringContent Schema { get; set; }
-
[Fact]
- public void IntegrationAccountSchema_ListByResourceGroup_Exception()
+ public void IntegrationAccountSchema_List_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -42,13 +41,12 @@ public void IntegrationAccountSchema_ListByResourceGroup_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(
- () => client.Schemas.ListByIntegrationAccounts(null, "IntegrationAccount"));
- Assert.Throws(() => client.Schemas.ListByIntegrationAccounts(ResourceGroupName,"IntegrationAccount"));
+ Assert.Throws(() => client.IntegrationAccountSchemas.List(null, "IntegrationAccount"));
+ Assert.Throws(() => client.IntegrationAccountSchemas.List(Constants.DefaultResourceGroup,"IntegrationAccount"));
}
[Fact]
- public void IntegrationAccountSchema_ListByResourceGroup_Success()
+ public void IntegrationAccountSchema_List_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -59,7 +57,7 @@ public void IntegrationAccountSchema_ListByResourceGroup_Success()
Content = this.SchemaList
};
- var result = client.Schemas.ListByIntegrationAccounts(ResourceGroupName, "IntegrationAccount");
+ var result = client.IntegrationAccountSchemas.List(Constants.DefaultResourceGroup, "IntegrationAccount");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -70,7 +68,7 @@ public void IntegrationAccountSchema_ListByResourceGroup_Success()
}
[Fact]
- public void IntegrationAccountSchema_ListByResourceGroupNext_Exception()
+ public void IntegrationAccountSchema_ListNext_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -81,12 +79,12 @@ public void IntegrationAccountSchema_ListByResourceGroupNext_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Schemas.ListByIntegrationAccountsNext(null));
- Assert.Throws(() => client.Schemas.ListByIntegrationAccountsNext(Constants.NextPageLink));
+ Assert.Throws(() => client.IntegrationAccountSchemas.ListNext(null));
+ Assert.Throws(() => client.IntegrationAccountSchemas.ListNext(Constants.NextPageLink));
}
[Fact]
- public void IntegrationAccountSchema_ListByResourceGroupNext_Success()
+ public void IntegrationAccountSchema_ListNext_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -97,7 +95,7 @@ public void IntegrationAccountSchema_ListByResourceGroupNext_Success()
Content = this.SchemaList
};
- var result = client.Schemas.ListByIntegrationAccountsNext(Constants.NextPageLink);
+ var result = client.IntegrationAccountSchemas.ListNext(Constants.NextPageLink);
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -119,11 +117,11 @@ public void IntegrationAccountSchema_CreateOrUpdate_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Schemas.CreateOrUpdate(null, "IntegrationAccountName", "SchemaName", new IntegrationAccountSchema()));
- Assert.Throws(() => client.Schemas.CreateOrUpdate(ResourceGroupName, null, "SchemaName", new IntegrationAccountSchema()));
- Assert.Throws(() => client.Schemas.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", null, new IntegrationAccountSchema()));
- Assert.Throws(() => client.Schemas.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "SchemaName", null));
- Assert.Throws(() => client.Schemas.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "SchemaName", new IntegrationAccountSchema()));
+ Assert.Throws(() => client.IntegrationAccountSchemas.CreateOrUpdate(null, "IntegrationAccountName", "SchemaName", new IntegrationAccountSchema(SchemaType.Xml)));
+ Assert.Throws(() => client.IntegrationAccountSchemas.CreateOrUpdate(Constants.DefaultResourceGroup, null, "SchemaName", new IntegrationAccountSchema(SchemaType.Xml)));
+ Assert.Throws(() => client.IntegrationAccountSchemas.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", null, new IntegrationAccountSchema(SchemaType.Xml)));
+ Assert.Throws(() => client.IntegrationAccountSchemas.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "SchemaName", null));
+ Assert.Throws(() => client.IntegrationAccountSchemas.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "SchemaName", new IntegrationAccountSchema(SchemaType.Xml)));
}
[Fact]
@@ -138,7 +136,7 @@ public void IntegrationAccountSchema_CreateOrUpdate_OK()
Content = this.Schema
};
- var schema = client.Schemas.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "SchemaName", new IntegrationAccountSchema());
+ var schema = client.IntegrationAccountSchemas.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "SchemaName", new IntegrationAccountSchema(SchemaType.Xml));
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -160,7 +158,7 @@ public void IntegrationAccountSchema_CreateOrUpdate_Created()
Content = this.Schema
};
- var schema = client.Schemas.CreateOrUpdate(ResourceGroupName, "IntegrationAccountName", "SchemaName", new IntegrationAccountSchema());
+ var schema = client.IntegrationAccountSchemas.CreateOrUpdate(Constants.DefaultResourceGroup, "IntegrationAccountName", "SchemaName", new IntegrationAccountSchema(SchemaType.Xml));
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -178,13 +176,14 @@ public void IntegrationAccountSchema_Delete_Exception()
handler.Response = new HttpResponseMessage
{
- StatusCode = HttpStatusCode.NotFound
+ StatusCode = HttpStatusCode.NotFound,
+ Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Schemas.Delete(null, "IntegrationAccountName","SchemaName"));
- Assert.Throws(() => client.Schemas.Delete(ResourceGroupName, null, "SchemaName"));
- Assert.Throws(() => client.Schemas.Delete(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.Schemas.Delete(ResourceGroupName, "IntegrationAccountName","SchemaName"));
+ Assert.Throws(() => client.IntegrationAccountSchemas.Delete(null, "IntegrationAccountName","SchemaName"));
+ Assert.Throws(() => client.IntegrationAccountSchemas.Delete(Constants.DefaultResourceGroup, null, "SchemaName"));
+ Assert.Throws(() => client.IntegrationAccountSchemas.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccountSchemas.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName","SchemaName"));
}
[Fact]
@@ -198,7 +197,7 @@ public void IntegrationAccountSchema_Delete_OK()
StatusCode = HttpStatusCode.OK
};
- client.Schemas.Delete(ResourceGroupName, "IntegrationAccountName", "SchemaName");
+ client.IntegrationAccountSchemas.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName", "SchemaName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -216,7 +215,7 @@ public void IntegrationAccountSchema_Delete_NoContent()
StatusCode = HttpStatusCode.NoContent
};
- client.Schemas.Delete(ResourceGroupName, "IntegrationAccountName","SchemaName");
+ client.IntegrationAccountSchemas.Delete(Constants.DefaultResourceGroup, "IntegrationAccountName","SchemaName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -235,10 +234,10 @@ public void IntegrationAccountSchema_Get_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Schemas.Get(null, "IntegrationAccountName", "SchemaName"));
- Assert.Throws(() => client.Schemas.Get(ResourceGroupName, null, "SchemaName"));
- Assert.Throws(() => client.Schemas.Get(ResourceGroupName, "IntegrationAccountName", null));
- Assert.Throws(() => client.Schemas.Get(ResourceGroupName, "IntegrationAccountName", "SchemaName"));
+ Assert.Throws(() => client.IntegrationAccountSchemas.Get(null, "IntegrationAccountName", "SchemaName"));
+ Assert.Throws(() => client.IntegrationAccountSchemas.Get(Constants.DefaultResourceGroup, null, "SchemaName"));
+ Assert.Throws(() => client.IntegrationAccountSchemas.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", null));
+ Assert.Throws(() => client.IntegrationAccountSchemas.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", "SchemaName"));
}
[Fact]
@@ -253,7 +252,7 @@ public void IntegrationAccountSchema_Get_OK()
Content = this.Schema
};
- var schema = client.Schemas.Get(ResourceGroupName, "IntegrationAccountName", "SchemaName");
+ var schema = client.IntegrationAccountSchemas.Get(Constants.DefaultResourceGroup, "IntegrationAccountName", "SchemaName");
// Validates request.
handler.Request.ValidateAuthorizationHeader();
@@ -265,7 +264,7 @@ public void IntegrationAccountSchema_Get_OK()
private void ValidateSchemaList(IPage result)
{
- Assert.Equal(1, result.Count());
+ Assert.Single(result);
this.ValidateSchema(result.First());
Assert.Equal(Constants.NextPageLink, result.NextPageLink);
}
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSessionInMemoryTests.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSession.InMemoryTests.cs
similarity index 73%
rename from src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSessionInMemoryTests.cs
rename to src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSession.InMemoryTests.cs
index bc96e38531c92..d286e86c22544 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSessionInMemoryTests.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/IntegrationAccountSession.InMemoryTests.cs
@@ -16,6 +16,10 @@ namespace Test.Azure.Management.Logic
public class IntegrationAccountSessionInMemoryTests : InMemoryTestsBase
{
+ private StringContent SessionList { get; set; }
+
+ private StringContent Session { get; set; }
+
public IntegrationAccountSessionInMemoryTests()
{
var content = File.ReadAllText(path: @"TestData/IntegrationAccountSessionResponseContent.json");
@@ -24,12 +28,8 @@ public IntegrationAccountSessionInMemoryTests()
this.Session = new StringContent(content);
}
- private StringContent SessionList { get; set; }
-
- private StringContent Session { get; set; }
-
[Fact]
- public void IntegrationAccountSession_ListByResourceGroup_Exception()
+ public void IntegrationAccountSession_List_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -40,12 +40,12 @@ public void IntegrationAccountSession_ListByResourceGroup_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Sessions.ListByIntegrationAccounts(null, "IntegrationAccount"));
- Assert.Throws(() => client.Sessions.ListByIntegrationAccounts(ResourceGroupName, "IntegrationAccount"));
+ Assert.Throws(() => client.IntegrationAccountSessions.List(null, "IntegrationAccount"));
+ Assert.Throws(() => client.IntegrationAccountSessions.List(Constants.DefaultResourceGroup, "IntegrationAccount"));
}
[Fact]
- public void IntegrationAccountSession_ListByResourceGroup_Success()
+ public void IntegrationAccountSession_List_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -56,7 +56,7 @@ public void IntegrationAccountSession_ListByResourceGroup_Success()
Content = this.SessionList
};
- var result = client.Sessions.ListByIntegrationAccounts(resourceGroupName: ResourceGroupName, integrationAccountName: "IntegrationAccount");
+ var result = client.IntegrationAccountSessions.List(resourceGroupName: Constants.DefaultResourceGroup, integrationAccountName: "IntegrationAccount");
handler.Request.ValidateAuthorizationHeader();
handler.Request.ValidateMethod(HttpMethod.Get);
@@ -65,7 +65,7 @@ public void IntegrationAccountSession_ListByResourceGroup_Success()
}
[Fact]
- public void IntegrationAccountSession_ListByResourceGroupNext_Exception()
+ public void IntegrationAccountSession_ListNext_Exception()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -76,12 +76,12 @@ public void IntegrationAccountSession_ListByResourceGroupNext_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Sessions.ListByIntegrationAccountsNext(nextPageLink: null));
- Assert.Throws(() => client.Sessions.ListByIntegrationAccountsNext(nextPageLink: Constants.NextPageLink));
+ Assert.Throws(() => client.IntegrationAccountSessions.ListNext(nextPageLink: null));
+ Assert.Throws(() => client.IntegrationAccountSessions.ListNext(nextPageLink: Constants.NextPageLink));
}
[Fact]
- public void IntegrationAccountSession_ListByResourceGroupNext_Success()
+ public void IntegrationAccountSession_ListNext_Success()
{
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
@@ -92,7 +92,7 @@ public void IntegrationAccountSession_ListByResourceGroupNext_Success()
Content = this.SessionList
};
- var result = client.Sessions.ListByIntegrationAccountsNext(nextPageLink: Constants.NextPageLink);
+ var result = client.IntegrationAccountSessions.ListNext(nextPageLink: Constants.NextPageLink);
handler.Request.ValidateAuthorizationHeader();
handler.Request.ValidateMethod(HttpMethod.Get);
@@ -112,28 +112,28 @@ public void IntegrationAccountSession_CreateOrUpdate_Exception()
Content = new StringContent(string.Empty)
};
- Assert.Throws(() => client.Sessions.CreateOrUpdate(
+ Assert.Throws(() => client.IntegrationAccountSessions.CreateOrUpdate(
resourceGroupName: null,
integrationAccountName: "IntegrationAccountName",
sessionName: "SessionName",
session: new IntegrationAccountSession()));
- Assert.Throws(() => client.Sessions.CreateOrUpdate(
- resourceGroupName: ResourceGroupName,
+ Assert.Throws(() => client.IntegrationAccountSessions.CreateOrUpdate(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: null,
sessionName: "SessionName",
session: new IntegrationAccountSession()));
- Assert.Throws(() => client.Sessions.CreateOrUpdate(
- resourceGroupName: ResourceGroupName,
+ Assert.Throws(() => client.IntegrationAccountSessions.CreateOrUpdate(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: "IntegrationAccountName",
sessionName: null,
session: new IntegrationAccountSession()));
- Assert.Throws(() => client.Sessions.CreateOrUpdate(
- resourceGroupName: ResourceGroupName,
+ Assert.Throws(() => client.IntegrationAccountSessions.CreateOrUpdate(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: "IntegrationAccountName",
sessionName: "SessionName",
session: null));
- Assert.Throws(() => client.Sessions.CreateOrUpdate(
- resourceGroupName: ResourceGroupName,
+ Assert.Throws(() => client.IntegrationAccountSessions.CreateOrUpdate(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: "IntegrationAccountName",
sessionName: "SessionName",
session: new IntegrationAccountSession()));
@@ -151,8 +151,8 @@ public void IntegrationAccountSession_CreateOrUpdate_OK()
Content = this.Session
};
- var result = client.Sessions.CreateOrUpdate(
- resourceGroupName: ResourceGroupName,
+ var result = client.IntegrationAccountSessions.CreateOrUpdate(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: "IntegrationAccountName",
sessionName: "SessionName",
session: new IntegrationAccountSession());
@@ -175,8 +175,8 @@ public void IntegrationAccountSession_CreateOrUpdate_Created()
Content = this.Session
};
- var result = client.Sessions.CreateOrUpdate(
- resourceGroupName: ResourceGroupName,
+ var result = client.IntegrationAccountSessions.CreateOrUpdate(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: "IntegrationAccountName",
sessionName: "SessionName",
session: new IntegrationAccountSession());
@@ -193,16 +193,16 @@ public void IntegrationAccountSession_Delete_Exception()
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
- Assert.Throws(() => client.Sessions.Delete(
+ Assert.Throws(() => client.IntegrationAccountSessions.Delete(
resourceGroupName: null,
integrationAccountName: "IntegrationAccountName",
sessionName: "SessionName"));
- Assert.Throws(() => client.Sessions.Delete(
- resourceGroupName: ResourceGroupName,
+ Assert.Throws(() => client.IntegrationAccountSessions.Delete(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: null,
sessionName: "SessionName"));
- Assert.Throws(() => client.Sessions.Delete(
- resourceGroupName: ResourceGroupName,
+ Assert.Throws(() => client.IntegrationAccountSessions.Delete(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: "IntegrationAccountName",
sessionName: null));
}
@@ -218,8 +218,8 @@ public void IntegrationAccountSession_Delete_OK()
StatusCode = HttpStatusCode.OK
};
- client.Sessions.Delete(
- resourceGroupName: ResourceGroupName,
+ client.IntegrationAccountSessions.Delete(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: "IntegrationAccountName",
sessionName: "SessionName");
@@ -238,8 +238,8 @@ public void IntegrationAccountSession_Delete_NoContent()
StatusCode = HttpStatusCode.NoContent
};
- client.Sessions.Delete(
- resourceGroupName: ResourceGroupName,
+ client.IntegrationAccountSessions.Delete(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: "IntegrationAccountName",
sessionName: "SessionName");
@@ -253,16 +253,16 @@ public void IntegrationAccountSession_Get_Exception()
var handler = new RecordedDelegatingHandler();
var client = this.CreateIntegrationAccountClient(handler);
- Assert.Throws(() => client.Sessions.Get(
+ Assert.Throws(() => client.IntegrationAccountSessions.Get(
resourceGroupName: null,
integrationAccountName: "IntegrationAccountName",
sessionName: "SessionName"));
- Assert.Throws(() => client.Sessions.Get(
- resourceGroupName: ResourceGroupName,
+ Assert.Throws(() => client.IntegrationAccountSessions.Get(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: null,
sessionName: "SessionName"));
- Assert.Throws(() => client.Sessions.Get(
- resourceGroupName: ResourceGroupName,
+ Assert.Throws(() => client.IntegrationAccountSessions.Get(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: "IntegrationAccountName",
sessionName: null));
}
@@ -279,8 +279,8 @@ public void IntegrationAccountSession_Get_OK()
Content = this.Session
};
- var result = client.Sessions.Get(
- resourceGroupName: ResourceGroupName,
+ var result = client.IntegrationAccountSessions.Get(
+ resourceGroupName: Constants.DefaultResourceGroup,
integrationAccountName: "IntegrationAccountName",
sessionName: "SessionName");
@@ -292,7 +292,7 @@ public void IntegrationAccountSession_Get_OK()
private void ValidateSessionList(IPage result)
{
- Assert.Equal(1, result.Count());
+ Assert.Single(result);
this.ValidateSession(result.First());
Assert.Equal(Constants.NextPageLink, result.NextPageLink);
}
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowRunActions.InMemoryTests.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowRunActions.InMemoryTests.cs
index 6360372bd8f15..bf9dfd8e1d8db 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowRunActions.InMemoryTests.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowRunActions.InMemoryTests.cs
@@ -95,7 +95,7 @@ public void WorkflowRunActions_List_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowRunActions.List(null, "wfName", "rName"));
@@ -139,7 +139,7 @@ public void WorkflowRunActions_ListNext_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowRunActions.ListNext(null));
@@ -181,7 +181,7 @@ public void WorkflowRunActions_Get_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowRunActions.Get(null, "wfName", "rName", "actName"));
@@ -305,7 +305,7 @@ private void ValidateRunAction1(WorkflowRunAction action)
private void ValidateRunActionListResponse1(IPage page)
{
- Assert.Equal(1, page.Count());
+ Assert.Single(page);
Assert.Equal("http://management.azure.com/actionNextLink", page.NextPageLink);
this.ValidateRunAction1(page.First());
}
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowRuns.InMemoryTests.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowRuns.InMemoryTests.cs
index 656935b542dc3..444162ba2ced6 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowRuns.InMemoryTests.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowRuns.InMemoryTests.cs
@@ -73,7 +73,7 @@ public void WorkflowRuns_List_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowRuns.List(null, "wfName"));
@@ -116,7 +116,7 @@ public void WorkflowRuns_ListNext_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowRuns.ListNext(null));
@@ -158,7 +158,7 @@ public void WorkflowRuns_Get_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowRuns.Get(null, "wfName", "rName"));
@@ -202,7 +202,7 @@ public void WorkflowRuns_Cancel_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowRuns.Cancel(null, "wfName", "rName"));
@@ -220,7 +220,7 @@ public void WorkflowRuns_Cancel_OK()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.OK,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
client.WorkflowRuns.Cancel("rgName", "wfName", "rName");
@@ -270,7 +270,7 @@ private void ValidateRun1(WorkflowRun run)
private void ValidateRunListResponse1(IPage page)
{
- Assert.Equal(1, page.Count());
+ Assert.Single(page);
Assert.Equal("http://management.azure.com/runNextLink", page.NextPageLink);
this.ValidateRun1(page.First());
}
diff --git a/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowTriggerHistories.InMemoryTests.cs b/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowTriggerHistories.InMemoryTests.cs
index 59b6befab6d0f..aaabe9347d950 100644
--- a/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowTriggerHistories.InMemoryTests.cs
+++ b/src/SDKs/Logic/Logic.Tests/InMemoryTests/WorkflowTriggerHistories.InMemoryTests.cs
@@ -74,7 +74,7 @@ public void WorkflowTriggerHistories_List_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowTriggerHistories.List(null, "wfName", "triggerName"));
@@ -118,7 +118,7 @@ public void WorkflowTriggerHistories_ListNext_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowTriggerHistories.ListNext(null));
@@ -160,7 +160,7 @@ public void WorkflowTriggerHistories_Get_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowTriggerHistories.Get(null, "wfName", "triggerName", "historyName"));
@@ -205,7 +205,7 @@ public void WorkflowTriggerHistories_Resubmit_Exception()
handler.Response = new HttpResponseMessage
{
StatusCode = HttpStatusCode.InternalServerError,
- Content = this.Empty
+ Content = new StringContent(string.Empty)
};
Assert.Throws(() => client.WorkflowTriggerHistories.Resubmit(null, "wfName", "triggerName", "historyName"));
@@ -278,7 +278,7 @@ private void ValidateTriggerHistory1(WorkflowTriggerHistory history)
private void ValidateTriggerHistoryListResponse1(IPage