public async Task CodeUnderTestReturnsCorrectValue(HttpStatusCode statusCode, bool expectedResult)
        {
            //Arrange
            _httpTest.RespondWith(statusCode.ToString(), (int)statusCode);

            //Act
            var result = await _codeToTest.MakeTheCall();

            //Assert
            Assert.That(result, Is.EqualTo(expectedResult));
        }
Beispiel #2
0
        public async Task CodeUnderTestReturnsCorrectValue(HttpStatusCode statusCode, bool expectedResult)
        {
            //Arrange
            bool result;
            var  codeToTest = new ExternalApiCaller();

            using (var httpTest = new HttpTest())
            {
                httpTest.RespondWith(statusCode.ToString(), (int)statusCode);

                //Act
                result = await codeToTest.MakeTheCall();
            }

            //Assert
            Assert.That(result, Is.EqualTo(expectedResult));
        }