public void getGroups()
        {
            getGroups function = new getGroups()
            {
                sortOrder = AbstractFunction.sortOrderEnum.ASC
            };
            AbstractMailrelayReply reply = TestCall(function);

            Assert.AreEqual(1, reply.status);
        }
Пример #2
0
        public void functionWithEnumCanBeUrlEncoded()
        {
            string expectedUrlEncoded = $"&function=getGroups&sortOrder=ASC";

            getGroups function = new getGroups()
            {
                sortOrder = AbstractFunction.sortOrderEnum.ASC,
            };

            AssertToGet(function, expectedUrlEncoded);
        }
        public void MailrelayWillNotBeCalledTooOften()
        {
            getGroups function = new getGroups()
            {
                offset = 0, count = 1, sortOrder = AbstractFunction.sortOrderEnum.ASC
            };

            TimeSpan waitTime = TimeSpan.FromSeconds(15);

            ((MailrelayConnection)_mailrelayConnection).sendInterval = waitTime;

            DateTime beforeCall = DateTime.Now;

            _mailrelayConnection.Send(function);
            _mailrelayConnection.Send(function);

            DateTime after2Calls = DateTime.Now;

            TimeSpan timeToMake2Calls = after2Calls - beforeCall;

            Assert.Greater(timeToMake2Calls, waitTime);
        }