Exemplo n.º 1
0
        public void GetMedianDecileFromAsheFeed(string jobProfileForAsheFeed, string expectedSocCode)
        {
            //Arrange
            var applicationLogger = A.Fake <IApplicationLogger>(ops => ops.Strict());
            var clientProxy       = A.Fake <IAsheHttpClientProxy>(ops => ops.Strict());

            //Act
            var httpResponseMessage = new HttpResponseMessage {
                StatusCode = HttpStatusCode.OK
            };

            A.CallTo(() => clientProxy.EstimatePayMdAsync(A <string> ._)).Returns(httpResponseMessage);
            A.CallTo(() => applicationLogger.Warn(A <string> ._)).DoesNothing();
            A.CallTo(() => applicationLogger.ErrorJustLogIt(A <string> ._, A <Exception> ._)).DoesNothing();
            ISalaryService lmiFeed = new SalaryService(applicationLogger, clientProxy);

            //Assert
            var response = lmiFeed.GetSalaryBySocAsync(jobProfileForAsheFeed);

            A.CallTo(() => clientProxy.EstimatePayMdAsync(A <string> .That.IsEqualTo(expectedSocCode))).MustHaveHappened();
            response.Result.Should().Be(null);
        }