Exemple #1
0
        public void SetUp()
        {
            MongoConnection connection = MongoConnection.GetConnection("test");
            UrlLogin        login      = UrlLogin.GetUrlLogin(connection, "test");

            _connection = DynamicsCrmConnection.GetConnection(login.Url, login.Username, login.Password);
        }
Exemple #2
0
        public void SetUp()
        {
            Connection.CleanDatabase();

            if (Config.Exists(Connection) == false)
            {
                Config config = new Config()
                {
                    EmailPassword = "******",
                    Email         = "testEmail",
                    EmailSmtpPort = 0,
                    EmailSmtpHost = "testHost",
                };

                config.Insert(Connection);
            }

            UrlLogin urlLogin = UrlLogin.GetUrlLogin(Connection, "test");

            DynamicsCrmConnection = DynamicsCrmConnection.GetConnection(urlLogin.Url, urlLogin.Username, urlLogin.Password);

            _mailrelayConnectionTester   = new MailrelayConnectionTester();
            _dynamicsCrmConnectionTester = new DynamicsCrmConnectionTester();
            _random = new Random();
        }
Exemple #3
0
        private UrlLogin InsertUrlLogin()
        {
            string name = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string url  = "www.test.com";

            UrlLogin urlLogin;

            if (UrlLogin.Exists(_connection, name) == false)
            {
                urlLogin = new UrlLogin()
                {
                    UrlName  = name,
                    Url      = url,
                    Password = "******",
                    Username = "******",
                };

                urlLogin.Insert(_connection);

                _createdUrlLogins.Add(urlLogin);
            }
            else
            {
                urlLogin = UrlLogin.GetUrlLogin(_connection, name);
            }

            return(urlLogin);
        }
Exemple #4
0
        public void ExistsReturnTrueIfUrlLoginExists()
        {
            UrlLogin urlLogin = InsertUrlLogin();

            bool exists = UrlLogin.Exists(_connection, urlLogin.UrlName);

            Assert.True(exists);
        }
Exemple #5
0
        public void GetUrlLoginRetreivesUrlLogin()
        {
            UrlLogin urlLoginOrigin = InsertUrlLogin();

            UrlLogin urlLoginRestored = UrlLogin.GetUrlLogin(_connection, urlLoginOrigin.UrlName);

            Assert.AreEqual(urlLoginOrigin.Password, urlLoginRestored.Password);
        }
Exemple #6
0
 public void TestFixtureSetUp()
 {
     _mongoConnection       = MongoConnection.GetConnection("test");
     _urlLogin              = UrlLogin.GetUrlLogin(_mongoConnection, "test");
     _dynamicsCrmConnection = DynamicsCrmConnection.GetConnection(_urlLogin.Url, _urlLogin.Username, _urlLogin.Password);
     _config = Config.GetConfig(_mongoConnection);
     _mailrelayConnection = new MailrelayConnection(_config.MailrelayUrl, _config.MailrelayApiKey);
 }
Exemple #7
0
        public void ExistsReturnFalseIfNoUrlLoginExists()
        {
            _connection.CleanDatabase();

            string name = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            bool exists = UrlLogin.Exists(_connection, name);

            Assert.False(exists);
        }
Exemple #8
0
        public void GetFirstTest()
        {
            _connection.CleanDatabase();
            UrlLogin urlLoginInserted = InsertUrlLogin();

            UrlLogin urlLoginReturned = UrlLogin.GetFirst(_connection);

            bool returnedIsInserted = urlLoginInserted.Url == urlLoginReturned.Url;

            Assert.True(returnedIsInserted);
        }
Exemple #9
0
        public void Test()
        {
            UrlLogin        urlLogin    = UrlLogin.GetUrlLogin(_mongoConnection, "KKAdmin");
            InterfaceHelper initializer = InterfaceHelper.GetInstance();

            initializer.AllowThumbprint(urlLogin.CertificateThumbprint);

            SystemInterface.KKAdminService.KKAdminServiceClient proxy = new SystemInterface.KKAdminService.KKAdminServiceClient();

            string version = proxy.GetVersion();

            Assert.AreEqual("1.00", version);
        }