Exemple #1
0
        public async void when_user_sign_in_with_facebook()
        {
            var account = await GetNewFacebookAccount();

            var sut      = new AuthServiceClient(BaseUrl, null, new DummyPackageInfo(), null, null);
            var response = await sut.AuthenticateFacebook(account.FacebookId);

            Assert.IsNotNull(response);
            Assert.IsNotNull(response.SessionId, "Test");
            Assert.AreEqual(account.FacebookId, response.UserName);
        }
Exemple #2
0
        protected async Task <Account> GetNewFacebookAccount()
        {
            var newAccount = new RegisterAccount {
                AccountId = Guid.NewGuid(), Phone = "5145551234", Country = new CountryISOCode("CA"), Email = GetTempEmail(), Name = "First Name Test", FacebookId = Guid.NewGuid().ToString(), Language = "en"
            };
            await AccountService.RegisterAccount(newAccount);

            var client       = new AuthServiceClient(BaseUrl, null, new DummyPackageInfo(), null, null);
            var authResponse = await client.AuthenticateFacebook(newAccount.FacebookId);

            SessionId = authResponse.SessionId;

            return(await AccountService.GetMyAccount());
        }
Exemple #3
0
        public void when_user_sign_in_with_invalid_facebook_id()
        {
            var sut = new AuthServiceClient(BaseUrl, null, new DummyPackageInfo(), null, null);

            Assert.Throws <WebServiceException>(async() => await sut.AuthenticateFacebook(Guid.NewGuid().ToString()), "Invalid UserName or Password");
        }