SamplingPointImageAddAsync() 공개 메소드

INfieldSurveysService.SamplingPointImageAddAsync(string, string, string)
public SamplingPointImageAddAsync ( string surveyId, string samplingPointId, string filePath ) : Task
surveyId string
samplingPointId string
filePath string
리턴 Task
        public void TestSamplingPointImageAddAsync_ServerAcceptsSamplingPointImage_ReturnsFilename()
        {
            const string surveyId = "SurveyId";
            const string samplingPointId = "SamplingPointId";
            const string fileName = "1.jpg";
            string filePath = Path.Combine(Directory.GetCurrentDirectory(), "Resources", fileName);

            var content = new ByteArrayContent(File.ReadAllBytes(filePath));

            var mockedNfieldConnection = new Mock<INfieldConnectionClient>();
            var mockedHttpClient = CreateHttpClientMock(mockedNfieldConnection);

            mockedHttpClient.Setup(client => client.PostAsync(It.IsAny<string>(), It.IsAny<ByteArrayContent>()))
                                    .Returns(CreateTask(HttpStatusCode.OK, new StringContent(JsonConvert.SerializeObject(fileName))));

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

            var result = target.SamplingPointImageAddAsync(surveyId, samplingPointId, filePath).Result;

            Assert.Equal(fileName, result);
        }