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

@ -67,10 +67,9 @@ public class UnitTestAppSettingsController
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(GetAppSettingsApi)}.json"), json);
Assert.IsNotNull(json);
Assert.IsTrue(json != "[]");
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_TestContext.ManagedMethod}.json"), json);
_Logger.Information($"{_TestContext?.TestName} completed");
}
@ -95,9 +94,8 @@ public class UnitTestAppSettingsController
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(GetBuildNumberAndGitCommitSevenApi)}.json"), json);
Assert.IsNotNull(json);
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_TestContext.ManagedMethod}.json"), json);
_Logger.Information($"{_TestContext?.TestName} completed");
}