コード例 #1
0
        public void CanStoreAndGet() {
            if(ignoreelastic)Assert.Ignore("no elastic search");
            var mq = _container.Get<IMessageQueue>();
            var message = new PostMessage {
                Addresses = new[] {"*****@*****.**"},
                From = "support",
                Body = "<h1>Привет</h1>"
            };
            message = mq.PushMessage(message);
            Assert.Less(10,message.Id.Length);
            Assert.Less(1990,message.CreateTime.Year);
            Assert.Less(1990,message.StartTime.Year);

            var message2 = mq.GetMessage(message.Id);
            Console.WriteLine(message2.stringify());
            Console.WriteLine(message.stringify());
            Assert.AreEqual(message.stringify(),message2.stringify());
        }