private AbstractMailrelayReply TestCall(AbstractFunction functionToCall)
        {
            AbstractMailrelayReply reply = _mailrelayConnection.Send(functionToCall);

            Console.Out.WriteLine(functionToCall.ToGet());
            Console.Out.WriteLine(reply.ToJson());

            return(reply);
        }
Exemple #2
0
        private void AssertToGet(AbstractFunction function, string expectedEncoded)
        {
            string apiKey             = "testApiKey";
            string expectedUrlEncoded = $"{expectedEncoded}&apiKey={apiKey}";

            function.apiKey = apiKey;

            string output = function.ToGet();

            Assert.AreEqual(expectedUrlEncoded, output);
        }
        public AbstractMailrelayReply Send(AbstractFunction functionToSend)
        {
            if (replies.Count == 0)
            {
                throw new Exception($"reply queue was empty when sending {HttpUtility.UrlDecode(functionToSend.ToGet())}");
            }

            sendFunctions.Add(functionToSend);

            AbstractMailrelayReply reply = replies.Dequeue();

            return(reply);
        }