Ejemplo n.º 1
0
        public void CreateQueueTest()
        {
            QueueService target = new QueueService();
            string queueName = "Test_ShouldWork";
            long firstTicketNumber = 1;
            string physicalAddress = string.Empty;
            bool isActive = true;
            Guid userID = new Guid("24f7bf2e-56ee-44f0-a70f-7e7fbb321c38");
            Classes.Queue result;

            try
            {
                result = target.CreateQueue(queueName, firstTicketNumber, physicalAddress, isActive, userID);
            }
            catch
            {
                Assert.Fail();
            }

            try
            {
                queueName = "Test_ShouldNotWork_WrongUser";
                userID = System.Guid.NewGuid();

                result = target.CreateQueue(queueName, firstTicketNumber, physicalAddress, isActive, userID);

                userID = new Guid("24f7bf2e-56ee-44f0-a70f-7e7fbb321c38");

                Assert.Fail();
            }
            catch {}

            try
            {
                queueName = "";

                result = target.CreateQueue(queueName, firstTicketNumber, physicalAddress, isActive, userID);

                Assert.Fail();
            }
            catch { }
        }
Ejemplo n.º 2
0
        public void GetQueueTest()
        {
            QueueService target = new QueueService();
            Guid queueID = new Guid("93b5c72f-1541-4909-83f0-87c295082127");
            Classes.Queue actual;
            actual = target.GetQueue(queueID);
            Assert.AreNotEqual(null, actual);

            queueID = System.Guid.NewGuid();
            actual = target.GetQueue(queueID);
            Assert.AreEqual(null, actual);
        }
Ejemplo n.º 3
0
        public void UpdateQueueTest()
        {
            QueueService target = new QueueService();

            Guid queueID = new Guid("93b5c72f-1541-4909-83f0-87c295082127");
            string queueName = "Test_ShouldWork";
            long nextTicketNumber = 41;
            string physicalAddress = string.Empty;
            bool isActive = false;

            bool actual;
            actual = target.UpdateQueue(queueID, queueName, nextTicketNumber, physicalAddress, isActive);
            Assert.AreEqual(true, actual);

            queueID = System.Guid.NewGuid();
            queueName = "Test_ShouldNotWork_WrongID";
            actual = target.UpdateQueue(queueID, queueName, nextTicketNumber, physicalAddress, isActive);
            Assert.AreEqual(false, actual);

            try
            {
                queueID = new Guid("93b5c72f-1541-4909-83f0-87c295082127");
                nextTicketNumber = -1;
                queueName = "Test_ShouldNotWork_WrongInvalidNextTicketNumber";
                actual = target.UpdateQueue(queueID, queueName, nextTicketNumber, physicalAddress, isActive);

                Assert.Fail();
            }
            catch { }
        }
Ejemplo n.º 4
0
        public void GetQueuesTest()
        {
            QueueService target = new QueueService();
            Guid userID = new Guid("24f7bf2e-56ee-44f0-a70f-7e7fbb321c39");
            List<Classes.Queue> actual;
            actual = target.GetQueues(userID);
            Assert.AreEqual(1, actual.Count);

            userID = System.Guid.NewGuid();
            actual = target.GetQueues(userID);
            Assert.AreEqual(0, actual.Count);
        }