コード例 #1
0
        public void GetStatus(
            [Frozen] Mock <IHttpClient> httpClientMock,
            [Greedy] SpiderComponent sut,
            int scanId,
            int status)
        {
            // ARRANGE
            var json = new JObject(
                new JProperty("status", status));

            httpClientMock.SetupApiCall(sut, CallType.View, "status",
                                        new Parameters
            {
                { "scanId", scanId }
            })
            .Returns(json.ToString())
            .Verifiable();

            // ACT
            var result = sut.GetStatus(scanId);

            // ASSERT
            result.Should().Be(status);
            httpClientMock.Verify();
        }