Nfield.Services.NfieldSurveysServiceTests.TestCreateOrUpdateQuotaAsync_Normal_CallsCorrectRoute C# (CSharp) Method

TestCreateOrUpdateQuotaAsync_Normal_CallsCorrectRoute() private method

        public void TestCreateOrUpdateQuotaAsync_Normal_CallsCorrectRoute()
        {
            const string surveyId = "surveyId";

            var mockedNfieldConnection = new Mock<INfieldConnectionClient>();
            var mockedHttpClient = CreateHttpClientMock(mockedNfieldConnection);
            mockedHttpClient
                .Setup(client => client.PutAsJsonAsync(It.IsAny<string>(), It.IsAny<QuotaLevel>()))
                .Returns(CreateTask(HttpStatusCode.OK, new StringContent("")));

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

            target.CreateOrUpdateQuotaAsync(surveyId, new QuotaLevel()).Wait();

            mockedHttpClient.Verify(
                hc => hc.PutAsJsonAsync(ServiceAddress + "surveys/" + surveyId + "/quota", It.IsAny<QuotaLevel>()),
                Times.Once());
        }
NfieldSurveysServiceTests