From fec838ee733915917ec025e02959ea7bf906b937 Mon Sep 17 00:00:00 2001 From: Baris Caglar Date: Mon, 19 Nov 2018 17:22:50 -0800 Subject: [PATCH] Changes to tests to compile. --- .../DefaultDocument.cs | 4 ++-- .../Handlers.cs | 4 ++-- .../Monitoring.cs | 4 ++-- .../Sites.cs | 21 ------------------- 4 files changed, 6 insertions(+), 27 deletions(-) diff --git a/test/Microsoft.IIS.Administration.Tests/DefaultDocument.cs b/test/Microsoft.IIS.Administration.Tests/DefaultDocument.cs index e03fbdb..bc1d153 100644 --- a/test/Microsoft.IIS.Administration.Tests/DefaultDocument.cs +++ b/test/Microsoft.IIS.Administration.Tests/DefaultDocument.cs @@ -106,7 +106,7 @@ namespace Microsoft.IIS.Administration.Tests Assert.True(DeleteFile(client, file)); } - file = CreateFile(client, feature, fileName); + file = CreateFileInternal(client, feature, fileName); Assert.NotNull(file); Assert.True(DeleteFile(client, file)); } @@ -141,7 +141,7 @@ namespace Microsoft.IIS.Administration.Tests return docFeature.Value("files"); } - public static JObject CreateFile(HttpClient client, JObject docFeature, string fileName) + public static JObject CreateFileInternal(HttpClient client, JObject docFeature, string fileName) { string featureUuid = docFeature.Value("id"); diff --git a/test/Microsoft.IIS.Administration.Tests/Handlers.cs b/test/Microsoft.IIS.Administration.Tests/Handlers.cs index af8f93a..2a81ec5 100644 --- a/test/Microsoft.IIS.Administration.Tests/Handlers.cs +++ b/test/Microsoft.IIS.Administration.Tests/Handlers.cs @@ -133,7 +133,7 @@ namespace Microsoft.IIS.Administration.Tests string result = null; try { - ChangeAllFeatureProperties(feature); + ChangeAllFeaturePropertiesInternal(feature); Assert.True(client.Patch(Utils.Self(feature), feature, out result)); JObject patchedFeature = JObject.Parse(result); AssertFeaturesEqual(feature, patchedFeature); @@ -149,7 +149,7 @@ namespace Microsoft.IIS.Administration.Tests } } - private void ChangeAllFeatureProperties(JObject handlers) + private void ChangeAllFeaturePropertiesInternal(JObject handlers) { handlers[allowedAccessProperty]["read"] = !handlers[allowedAccessProperty].Value("read"); handlers[allowedAccessProperty]["write"] = !handlers[allowedAccessProperty].Value("write"); diff --git a/test/Microsoft.IIS.Administration.Tests/Monitoring.cs b/test/Microsoft.IIS.Administration.Tests/Monitoring.cs index 01d4ec1..c1791a8 100644 --- a/test/Microsoft.IIS.Administration.Tests/Monitoring.cs +++ b/test/Microsoft.IIS.Administration.Tests/Monitoring.cs @@ -414,7 +414,7 @@ namespace Microsoft.IIS.Administration.Tests var result = await responseMessage.Content.ReadAsStringAsync(); _snapshot = JObject.Parse(result); } - catch (Exception e) { + catch { ErrorCount++; } @@ -466,7 +466,7 @@ namespace Microsoft.IIS.Administration.Tests try { await client.GetAsync(Uri); } - catch (Exception e) { + catch { } await Task.Delay(20); diff --git a/test/Microsoft.IIS.Administration.Tests/Sites.cs b/test/Microsoft.IIS.Administration.Tests/Sites.cs index 2773160..e50e767 100644 --- a/test/Microsoft.IIS.Administration.Tests/Sites.cs +++ b/test/Microsoft.IIS.Administration.Tests/Sites.cs @@ -506,27 +506,6 @@ namespace Microsoft.IIS.Administration.Tests return Globals.Success(response); } - public static bool GetSites(HttpClient client, out List sites) - { - string response = null; - sites = null; - - if(!client.Get(SITE_URL, out response)) { - return false; - } - - JObject jObj = JsonConvert.DeserializeObject(response); - - JArray sArr = jObj["websites"] as JArray; - sites = new List(); - - foreach(JObject site in sArr) { - sites.Add(site); - } - - return true; - } - public static JObject GetSite(HttpClient client, string name) { var site = client.Get(SITE_URL)["websites"]