Mock json files
This commit is contained in:
@ -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");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user