Esempio n. 1
0
        public void RetrieveParametersNoToken()
        {
            var headers = new HeaderDictionary();

            string actual;

            ExecutionFilterAttribute.RetrieveParameters(headers, out actual);

            Assert.IsNull(actual);
        }
Esempio n. 2
0
        public void RetrieveParametersFormatMismatch3()
        {
            var headers = new HeaderDictionary();

            headers.Add("Authorization", "");

            string actual;

            ExecutionFilterAttribute.RetrieveParameters(headers, out actual);

            Assert.IsNull(actual);
        }
Esempio n. 3
0
        public void RetrieveParametersFormatMismatch2()
        {
            const string token = "sampletoken";

            var headers = new HeaderDictionary();

            headers.Add("Authorization", token);

            string actual;

            ExecutionFilterAttribute.RetrieveParameters(headers, out actual);

            Assert.IsNull(actual);
        }
Esempio n. 4
0
        public void RetrieveParameters()
        {
            const string token = "sampletoken";

            var headers = new HeaderDictionary();

            headers.Add("Authorization", "Bearer " + token);

            string actual;

            ExecutionFilterAttribute.RetrieveParameters(headers, out actual);

            Assert.AreEqual(actual, token);
        }