コード例 #1
0
        public void Ctor_Initializes()
        {
            // arrange

            // act
            var content = new FormUrlEncodedContent(_testObject);

            // assert
            Assert.NotNull(content);
        }
コード例 #2
0
        public async Task Ctor_StreamsAreEqual()
        {
            // arrange
            var values = new Dictionary <string, string> {
                { "FirstName", "Jon" }, { "LastName", "Snow" }
            };
            var formContent = new FormUrlEncodedContent(values);

            // act
            var content    = new FormUrlEncodedContent(_testObject);
            var formString = await formContent.ReadAsStringAsync();

            var objectFormString = await content.ReadAsStringAsync();

            // assert
            Assert.Equal(formString, objectFormString);
        }