Exemple #1
0
        public void RegisterFacebookClient_GivenOneRecord_Registers()
        {
            DatabaseMigrations.DeleteAndUpgradeDatabase(TestContext);

            var fixture = FixtureFactory.CreateFixture();


            var faceBookAppCredential =
                fixture.Build <FaceBookAppCredential>().With(p => p.Active, true).CreateAnonymous();

            ProoftedDbContext.Borrow(context =>
            {
                context.FaceBookAppCredentials.Add(
                    faceBookAppCredential);

                context.SaveChanges();
            });

            var mock = fixture.Freeze <Mock <IOAuthWebSecurity> >();

            var reg = fixture.CreateAnonymous <OAuthRegistrar>();

            reg.RegisterFacebookClient();

            mock.Verify(p => p.RegisterFacebookClient(faceBookAppCredential.AppId, faceBookAppCredential.SecretKey));
        }
Exemple #2
0
 public static List <FaceBookAppCredential> GetFaceBookSettings()
 {
     return
         (ProoftedDbContext.Borrow(
              context => context.FaceBookAppCredentials.Where(credential => credential.Active).ToList()));
 }