Beispiel #1
0
        public void AddTest()
        {
            //----------------------------------------------------------------------------------------------------
            //---only init the domain records which will force a cleaning of the mx records
            InitDomainRecords();
            MXManager mgr = new MXManager(new ConfigStore(CONNSTR));

            //----------------------------------------------------------------------------------------------------
            //---make sure there are no mx records that exist
            Assert.Equal(0, mgr.Count());

            long   domainId   = 1; //--we always have domain id of 1 (unless someone changed testing values in base)
            string SMTPName   = BuildSMTPDomainName(1, 1);
            int    preference = 10;
            MX     mx         = new MX(domainId
                                       , SMTPName
                                       , preference);

            mgr.Add(mx);
            Assert.Equal(1, mgr.Count());
            mx = mgr.Get(SMTPName);
            Assert.Equal(domainId, mx.DomainID);
            Assert.Equal(SMTPName, mx.SMTPDomainName);
            Assert.Equal(preference, mx.Preference);
        }
Beispiel #2
0
        public void AddTest()
        {
            //----------------------------------------------------------------------------------------------------
            //---only init the domain records which will force a cleaning of the mx records
            InitDomainRecords();
            MXManager mgr = new MXManager(new ConfigStore(CONNSTR));
            //----------------------------------------------------------------------------------------------------
            //---make sure there are no mx records that exist
            Assert.Equal(0, mgr.Count());

            long domainId = 1; //--we always have domain id of 1 (unless someone changed testing values in base)
            string SMTPName = BuildSMTPDomainName(1, 1);
            int preference = 10;
            MX mx = new MX(domainId
                           , SMTPName
                           , preference);

            mgr.Add(mx);
            Assert.Equal(1, mgr.Count());
            mx = mgr.Get(SMTPName);
            Assert.Equal(domainId, mx.DomainID);
            Assert.Equal(SMTPName, mx.SMTPDomainName);
            Assert.Equal(preference, mx.Preference);
            
        }