SamplingPointsCountAsync() 공개 메소드

See INfieldSurveysService.SamplingPointsCountAsync
public SamplingPointsCountAsync ( string surveyId ) : Task
surveyId string
리턴 Task
        public void TestSamplingPointsCountAsync_ServerReturnsCount_ReturnsNumberOfSamplingPointsForTheSurvey()
        {
            const string surveyId = "123";
            const int samplingPointCount = 5;
            var uri = $@"{ServiceAddress}surveys/{surveyId}/samplingpoints/Count";
            var mockedNfieldConnection = new Mock<INfieldConnectionClient>();
            var mockedHttpClient = CreateHttpClientMock(mockedNfieldConnection);
            mockedHttpClient
                .Setup(client => client.GetAsync(uri))
                .Returns(CreateTask(HttpStatusCode.OK, new StringContent(samplingPointCount.ToString())));
            var target = new NfieldSurveysService();
            target.InitializeNfieldConnection(mockedNfieldConnection.Object);

            var result = target.SamplingPointsCountAsync(surveyId).Result;

            Assert.Equal(samplingPointCount, result);
        }