Nfield.Services.NfieldAddressesServiceTests.TestGetCountAsync_ServerReturnsCount_ReturnsNumberOfAddresses C# (CSharp) Method

TestGetCountAsync_ServerReturnsCount_ReturnsNumberOfAddresses() private method

        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);
        }