forked from haoduotnt/aspnetwebstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHttpHeaderExtensionsTest.cs
30 lines (25 loc) · 1.03 KB
/
HttpHeaderExtensionsTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
using System.Net.Http.Headers;
using Microsoft.TestCommon;
namespace System.Net.Http
{
public class HttpHeaderExtensionsTest
{
[Fact]
public void CopyTo_CopiesContentHeaders()
{
// Arrange
HttpContentHeaders source = FormattingUtilities.CreateEmptyContentHeaders();
source.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf8; parameter=value");
source.ContentLength = 1234;
source.ContentLocation = new Uri("http://some.host");
source.Add("test-name1", "test-value1");
source.Add("test-name2", "test-value2");
HttpContentHeaders destination = FormattingUtilities.CreateEmptyContentHeaders();
// Act
source.CopyTo(destination);
// Assert
Assert.Equal(source.ToString(), destination.ToString());
}
}
}