Ejemplo n.º 1
0
        public void PostFileStatusTest()
        {
            HttpResponseMessage response = new HttpResponseMessage();

            HttpContent content = null;

            content.Headers.Add("string1", "string1");

            System.Net.Http.Headers.HttpResponseHeaders header = null;
            header.Add("string1", "string1");

            response.Content = content;
            response.Headers.Add("string1", "string1");
            response.IsSuccessStatusCode.Equals(true);
            response.ReasonPhrase.Equals("string1");
            response.RequestMessage.Content.Headers.Add("string1", "string1");
            response.StatusCode.Equals("Success");
            response.Version.Major.Equals(1);

            UploadManagerController target   = new UploadManagerController(); // TODO: Initialize to an appropriate value
            HttpResponseMessage     expected = null;                          // TODO: Initialize to an appropriate value
            HttpResponseMessage     actual;

            actual = target.PostFileStatus();
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        public void GetTest()
        {
            HttpResponseMessage response = new HttpResponseMessage();

            //var formVars = new Dictionary<string,string>();
            //formVars.Add("message", "Some Value");
            //var content = new FormUrlEncodedContent(formVars);
            HttpContent content = null;

            content.Headers.Add("string1", "string1");

            System.Net.Http.Headers.HttpResponseHeaders header = null;
            header.Add("string1", "string1");

            response.Content = content;
            response.Headers.Add("string1", "string1");
            response.IsSuccessStatusCode.Equals(true);
            response.ReasonPhrase.Equals("string1");
            response.RequestMessage.Content.Headers.Add("string1", "string1");
            response.StatusCode.Equals(null);
            response.Version.Major.Equals(1);

            SharedAccessSignatureController target   = new SharedAccessSignatureController(); // TODO: Initialize to an appropriate value
            HttpResponseMessage             expected = response;                              // TODO: Initialize to an appropriate value
            HttpResponseMessage             actual;

            actual = target.Get();
            Assert.AreEqual(expected, actual);
            // Assert.Inconclusive("Verify the correctness of this test method.");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Copies headers from one <see cref="System.Net.Http.HttpResponseMessage"/> instance to another.
        /// </summary>
        /// <param name="source">The source <see cref="System.Net.Http.HttpResponseMessage"/> to copy from.</param>
        /// <param name="destination">The destination <see cref="System.Net.Http.HttpResponseMessage"/> to copy to.</param>
        public static void CopyHeadersTo(this System.Net.Http.Headers.HttpResponseHeaders source, System.Net.Http.Headers.HttpResponseHeaders destination)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }

            foreach (var header in source)
            {
                if (destination.Contains(header.Key))
                {
                    destination.Remove(header.Key);
                }

                destination.Add(header.Key, header.Value);
            }
        }