public void IsSubscribed_ReturnsTrueIfSubscribed()
        {
            var fakes = Get <Fakes>();

            fakes.User.SecurityPolicies = _policy.Policies.ToList();

            Assert.True(RequireSecurePushForCoOwnersPolicy.IsSubscribed(fakes.User));
        }
        public SecurityPolicyService(IEntitiesContext entitiesContext, IAuditingService auditing, IDiagnosticsService diagnostics,
                                     SecurePushSubscription securePush = null, RequireSecurePushForCoOwnersPolicy securePushForCoOwners = null)
        {
            EntitiesContext       = entitiesContext ?? throw new ArgumentNullException(nameof(entitiesContext));
            Auditing              = auditing ?? throw new ArgumentNullException(nameof(auditing));
            SecurePush            = securePush;
            SecurePushForCoOwners = securePushForCoOwners;

            if (diagnostics == null)
            {
                throw new ArgumentNullException(nameof(diagnostics));
            }

            Diagnostics = diagnostics.SafeGetSource(nameof(SecurityPolicyService));
        }
        public void IsSubscribed_ReturnsFalseIfNotSubscribed()
        {
            var fakes = Get <Fakes>();

            Assert.False(RequireSecurePushForCoOwnersPolicy.IsSubscribed(fakes.User));
        }
 public RequireSecurePushForCoOwnersPolicyFacts()
 {
     _policy = new RequireSecurePushForCoOwnersPolicy();
 }