Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }