示例#1
0
        static void Main(string[] args)
        {
            QueueServices queueServices = new QueueServices();

            //Get message from Queue.
            string message = queueServices.GetMessage(ConfigReader.ConnectionStringAZ, ConfigReader.QueueName);

            if (string.IsNullOrEmpty(message))
            {
                Console.WriteLine(message);
            }
            else
            {
                Console.WriteLine("Message Not Found");
            }
            Console.ReadKey();
        }
        public async Task Add_Members_To_Badge_Add_Message_To_The_Queue()
        {
            QueueServices.Clear <AssignedBadgeToMember>();
            FillData();

            var a = await HttpClient.PostAsync($"/groupcodes/{_newGroupCode.Id}/badges/{_newBadge.Id}", null);

            var bb = await a.Content.ReadAsStringAsync();

            var message = QueueServices.GetMessage <AssignedBadgeToMember>();

            message.MemberId.Should().NotBe(0);
            message.BadgeId.Should().Be(_newBadge.Id);
            Action act = () => QueueServices.GetMessage <AssignedBadgeToMember>();

            act.Should().Throw <NullReferenceException>();

            QueueServices.Clear <AssignedBadgeToMember>();
        }