GetCountAsync() 공개 메소드

public GetCountAsync ( string surveyId, string samplingPointId ) : Task
surveyId string
samplingPointId string
리턴 Task
        public void TestGetCountAsync_ServerReturnsCount_ReturnsNumberOfAddresses()
        {
            var uri = $"{ServiceAddress}Surveys/{SurveyId}/SamplingPoints/{SamplingPointId}/Addresses/Count";
            var expectedCount = 8;

            var mockedNfieldConnection = new Mock<INfieldConnectionClient>();
            var mockedHttpClient = CreateHttpClientMock(mockedNfieldConnection);
            mockedHttpClient
                .Setup(client => client.GetAsync(uri))
                .Returns(CreateTask(HttpStatusCode.OK, new StringContent(expectedCount.ToString())));

            var target = new NfieldAddressesService();
            target.InitializeNfieldConnection(mockedNfieldConnection.Object);

            var actualCount = target.GetCountAsync(SurveyId, SamplingPointId).Result;
            Assert.Equal(expectedCount, actualCount);
        }