Mock json files

This commit is contained in:
2023-01-13 19:59:33 -07:00
parent c292328abe
commit 4185d159c4
26 changed files with 647 additions and 104 deletions

View File

@ -57,10 +57,9 @@ public class UnitTestClientSettingsController
Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode);
Assert.AreEqual("application/json; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString());
string json = await httpResponseMessage.Content.ReadAsStringAsync();
httpClient.Dispose();
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{nameof(GetClientSettingsApi)}.json"), json);
Assert.IsNotNull(json);
Assert.IsTrue(json != "[]");
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_TestContext.ManagedMethod}.json"), json);
_Logger.Information($"{_TestContext?.TestName} completed");
}
@ -85,9 +84,8 @@ public class UnitTestClientSettingsController
Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode);
Assert.AreEqual("text/plain; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString());
string json = await httpResponseMessage.Content.ReadAsStringAsync();
httpClient.Dispose();
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{nameof(GetIpAddressApi)}.json"), json);
Assert.IsNotNull(json);
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_TestContext.ManagedMethod}.json"), json);
_Logger.Information($"{_TestContext?.TestName} completed");
}