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

TestUpdateAsync_InterviewerExists_ReturnsInterviewer() private method

        public void TestUpdateAsync_InterviewerExists_ReturnsInterviewer()
        {
            const string surveyId = "aSurveyId";
            var survey = new Survey(SurveyType.Basic)
            {
                SurveyId = surveyId,
                Description = "updated description"
            };
            var mockedNfieldConnection = new Mock<INfieldConnectionClient>();
            var mockedHttpClient = CreateHttpClientMock(mockedNfieldConnection);
            mockedHttpClient
                .Setup(client => client.PatchAsJsonAsync(ServiceAddress + "surveys/" + surveyId, It.IsAny<UpdateSurvey>()))
                .Returns(CreateTask(HttpStatusCode.OK, new StringContent(JsonConvert.SerializeObject(survey))));

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

            var actual = target.UpdateAsync(survey).Result;

            Assert.Equal(survey.Description, actual.Description);
        }
NfieldSurveysServiceTests