Example #1
0
        public void GetWebAuthenticationResponse_Fail()
        {
            //Arrange
            var authHelper = new WebAuthenticationHelper(GetOAuthCompleteUri());
            var list       = GetNavigationUris(1);

            var dictionary = new Dictionary <string, string>();

            dictionary.Add("test", "test123");
            dictionary.Add("test2", "test2123");

            //Act
            bool found = false;
            Dictionary <string, string> response = null;

            foreach (var uri in list)
            {
                if (authHelper.IsComplete(uri, out response))
                {
                    found = true;
                    break;
                }
            }

            found.Should().BeFalse();
            (response == null).Should().BeTrue();
        }
Example #2
0
        public void GetWebAuthenticationResponse_Success()
        {
            //Arrange
            var authHelper = new WebAuthenticationHelper(GetOAuthCompleteUri());
            var list       = GetNavigationUris();

            var dictionary = new Dictionary <string, string>();

            dictionary.Add("test", "test123");
            dictionary.Add("test2", "test2123");

            list.Add(GetOAuthCompleteUriWithParameters(dictionary));

            //Act
            bool found = false;
            Dictionary <string, string> response = null;

            foreach (var uri in list)
            {
                if (authHelper.IsComplete(uri, out response))
                {
                    found = true;
                    break;
                }
            }

            found.Should().BeTrue();
            response.Should().ContainKey("test");
            response.Should().ContainKey("test2");
        }