public void ItReturnsFalseOnEmptyDiagnosticsEndpointUrl() { // Arrange DiagnosticsClient target = new DiagnosticsClient( this.mockHttpClient.Object, new ServicesConfig(), this.mockLogger.Object); // Act var result = target.SendAsync(JsonConvert.SerializeObject(this.data)).Result; // Assert Assert.False(result); }
public void ItReturnsTrueOnSucceess() { // Arrange var response = new HttpResponse(); DiagnosticsClient target = new DiagnosticsClient( this.mockHttpClient.Object, new ServicesConfig { DiagnosticsEndpointUrl = DIAGNOSTICS_SERVICE_URL }, this.mockLogger.Object); this.mockHttpClient .Setup(x => x.PostAsync(It.IsAny <IHttpRequest>())) .ReturnsAsync(response); // Act var result = target.SendAsync(JsonConvert.SerializeObject(this.data)).Result; // Assert Assert.False(result); }