Example #1
0
        public void LdapUtility_ConnectToGroup_FncConnectToGroupLdapBehavior()
        {
            //Arrange
            var fncConnectToLdapBehavior = new FncConnectToGroupLdapBehavior(TestHelper.GetConfigurationSettings());

            //Act Assert
            try
            {
                using (fncConnectToLdapBehavior.Connect())
                {
                    Assert.IsTrue(true);
                }
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message);
            }
        }
Example #2
0
        public async Task LdapUtility_HealthCheck_Behaviors()
        {
            //Arrange
            var coreLogicToAuthBehavior    = new CoreLogicConnectToAuthLdapBehavior(TestHelper.GetConfigurationSettings());
            var fncConnectToLdapBehavior   = new FncConnectToGroupLdapBehavior(TestHelper.GetConfigurationSettings());
            var getLdapGroupsBehavior      = new GetLdapGroupsBehavior();
            var healthCheckNotifierUtility = new Mock <IHealthCheckNotifierUtility>();

            var ldapUtility = new LdapUtility(coreLogicToAuthBehavior, fncConnectToLdapBehavior, getLdapGroupsBehavior);

            //Act
            var healthCheckUtility = new HealthCheckUtility(new List <IHealthCheckable>()
            {
                ldapUtility
            }, healthCheckNotifierUtility.Object, TestHelper.GetConfigurationSettings());

            //Assert
            Assert.AreEqual((await healthCheckUtility.GetHealthCheckResultAsync().ConfigureAwait(false)).Status, HealthStatus.Active);
        }