Example #1
0
        public static IEnumerable <object[]> Ctor_ExpectedPropertyValues_MemberData()
        {
            yield return(new object[] { new WebProxy(), null, false, false, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy("http://anything"), new Uri("http://anything"), false, false, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy("http://anything:42"), new Uri("http://anything:42"), false, false, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy("anything:42"), new Uri("http://anything:42"), false, false, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy("anything", 42), new Uri("http://anything:42"), false, false, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy("http://anything", 42), new Uri("http://anything:42"), false, false, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy("http://anything:123", 42), new Uri("http://anything:42"), false, false, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy("socks5://anything", 42), new Uri("socks5://anything:42"), false, false, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy(new Uri("http://anything")), new Uri("http://anything"), false, false, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy("http://anything", true), new Uri("http://anything"), false, true, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy(new Uri("http://anything"), true), new Uri("http://anything"), false, true, Array.Empty <string>(), null });

            yield return(new object[] { new WebProxy("http://anything.com", true, new[] { ".*.com" }), new Uri("http://anything.com"), false, true, new[] { ".*.com" }, null });

            yield return(new object[] { new WebProxy(new Uri("http://anything.com"), true, new[] { ".*.com" }), new Uri("http://anything.com"), false, true, new[] { ".*.com" }, null });

            var c = new DummyCredentials();

            yield return(new object[] { new WebProxy("http://anything.com", true, new[] { ".*.com" }, c), new Uri("http://anything.com"), false, true, new[] { ".*.com" }, c });

            yield return(new object[] { new WebProxy(new Uri("http://anything.com"), true, new[] { ".*.com" }, c), new Uri("http://anything.com"), false, true, new[] { ".*.com" }, c });
        }
Example #2
0
        public void LoginCommandTo_Navigates_To_AnotherPage_When_Login_Is_Successful_And_Saves_Credentials()
        {
            ClubUser testUser = new ClubUser
            {
                UserId          = "TestID",
                Email           = "testEmail",
                IsEmailVerified = true,
                Name            = "Test Name",
                Surname         = "Test Surname",
                Phone           = "Test Phone"
            };
            ICredentials secureCredentials = new DummyCredentials();

            _authService.LoginWithEmailAndPasswordAsync("testEmail", "testPassword", true, false).Returns(
                new AuthResult
            {
                Result = "Success",
                User   = testUser
            });
            _sut = new LoginPageViewModel(_navigationService, _pageDialogService, _authService, secureCredentials);
            _sut.OnNavigatedTo(_parameters);

            _sut.Email    = "testEmail";
            _sut.Password = "******";
            _sut.LoginCommand.Execute();

            Assert.That(secureCredentials.Password, Is.EqualTo("testPassword"));
            Assert.That(secureCredentials.User, Is.EqualTo(testUser));
            _navigationService.Received(1).NavigateAsync("AnotherPage");
        }
Example #3
0
 public static void Credentials_Roundtrips()
 {
     var wc = new WebClient();
     var c = new DummyCredentials();
     wc.Credentials = c;
     Assert.Same(c, wc.Credentials);
     wc.Credentials = null;
     Assert.Null(wc.Credentials);
 }
Example #4
0
        public static IEnumerable<object[]> Ctor_ExpectedPropertyValues_MemberData()
        {
            yield return new object[] { new WebProxy(), null, false, false, Array.Empty<string>(), null };

            yield return new object[] { new WebProxy("http://anything"), new Uri("http://anything"), false, false, Array.Empty<string>(), null };
            yield return new object[] { new WebProxy("anything", 42), new Uri("http://anything:42"), false, false, Array.Empty<string>(), null };
            yield return new object[] { new WebProxy(new Uri("http://anything")), new Uri("http://anything"), false, false, Array.Empty<string>(), null };

            yield return new object[] { new WebProxy("http://anything", true), new Uri("http://anything"), false, true, Array.Empty<string>(), null };
            yield return new object[] { new WebProxy(new Uri("http://anything"), true), new Uri("http://anything"), false, true, Array.Empty<string>(), null };

            yield return new object[] { new WebProxy("http://anything.com", true, new[] { ".*.com" }), new Uri("http://anything.com"), false, true, new[] { ".*.com" }, null };
            yield return new object[] { new WebProxy(new Uri("http://anything.com"), true, new[] { ".*.com" }), new Uri("http://anything.com"), false, true, new[] { ".*.com" }, null };

            var c = new DummyCredentials();
            yield return new object[] { new WebProxy("http://anything.com", true, new[] { ".*.com" }, c), new Uri("http://anything.com"), false, true, new[] { ".*.com" }, c };
            yield return new object[] { new WebProxy(new Uri("http://anything.com"), true, new[] { ".*.com" }, c), new Uri("http://anything.com"), false, true, new[] { ".*.com" }, c };
        }
Example #5
0
 public static void Credentials_Roundtrips()
 {
     var wc = new WebClient();
     var c = new DummyCredentials();
     wc.Credentials = c;
     Assert.Same(c, wc.Credentials);
     wc.Credentials = null;
     Assert.Null(wc.Credentials);
 }