コード例 #1
0
ファイル: ApiTest.cs プロジェクト: jwplayer/jwplatform-dotnet
        public void MakePostRequest_GivenValidDeletePath_CompletesSuccessfully()
        {
            var mockClient    = MockClient.GetMockClient("testKey", "testSecret");
            var mockApi       = new Api(mockClient);
            var requestParams = new Dictionary <string, string> {
                { "video_key", "MEDIA_ID" },
            };
            var result = mockApi.PostRequest("/videos/delete", requestParams, true);

            Assert.Equal("Ok", result["status"]["message"]);
            Assert.Equal(200, result["status"]["code"]);
        }
コード例 #2
0
ファイル: ApiTest.cs プロジェクト: jwplayer/jwplatform-dotnet
        public async void MakePostRequestAsync_GivenSpecialCharacters_CompletesSuccessfully()
        {
            var mockClient    = MockClient.GetMockClient("testKey", "testSecret");
            var mockApi       = new Api(mockClient);
            var requestParams = new Dictionary <string, string> {
                { "video_key", "MEDIA_ID" },
                { "special_characters", "te$t media&*" }
            };
            var result = await mockApi.PostRequestAsync("/videos/delete", requestParams, true);

            Assert.Equal("Ok", result["status"]["message"]);
            Assert.Equal(200, result["status"]["code"]);
        }