public
Description:
Homepage: http://www.iserviceoriented.com
Clone URL: git://github.com/jezell/iserviceoriented.git
iserviceoriented / IServiceOriented.ServiceBus.UnitTests / TestMsmqMessageDeliveryQueueStatics.cs
100644 58 lines (52 sloc) 1.785 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using IServiceOriented.ServiceBus.Delivery;
 
namespace IServiceOriented.ServiceBus.UnitTests
{
[TestFixture]
    public class TestMsmqMessageDeliveryQueueStatics
    {
[TestFixtureSetUp]
        public void Init()
        {
            if (Config.TestQueuePath == null)
            {
                Assert.Ignore("Test msmq queue not configured. Skipping");
            }
        }
 
[Test]
        public void Can_Create_Queue()
        {
            if (MsmqMessageDeliveryQueue.Exists(Config.TestQueuePath))
            {
                MsmqMessageDeliveryQueue.Delete(Config.TestQueuePath);
            }
            MsmqMessageDeliveryQueue.Create(Config.TestQueuePath);
        }
 
[Test]
        public void Can_Delete_Queue()
        {
            if (!MsmqMessageDeliveryQueue.Exists(Config.TestQueuePath))
            {
                MsmqMessageDeliveryQueue.Create(Config.TestQueuePath);
            }
            MsmqMessageDeliveryQueue.Delete(Config.TestQueuePath);
            Assert.IsFalse(MsmqMessageDeliveryQueue.Exists(Config.TestQueuePath));
        }
 
[Test]
        public void Can_Check_Queue_Existence()
        {
            if (MsmqMessageDeliveryQueue.Exists(Config.TestQueuePath))
            {
                MsmqMessageDeliveryQueue.Delete(Config.TestQueuePath);
            }
            MsmqMessageDeliveryQueue.Create(Config.TestQueuePath);
            Assert.IsTrue(MsmqMessageDeliveryQueue.Exists(Config.TestQueuePath));
            MsmqMessageDeliveryQueue.Delete(Config.TestQueuePath);
            Assert.IsFalse(MsmqMessageDeliveryQueue.Exists(Config.TestQueuePath));
        }
 
    }
}