Exemplo n.º 1
0
        public void IDNotIntServiceCodePacketConstructor()
        {
            string action     = "add member";
            string sessionID  = "1234";
            float  fee        = 250;
            string id         = "Choc Therapy";
            string name       = "John Smith";
            string providerID = "123456";

            ServiceCodePacket testPacket;

            Assert.ThrowsException <ArgumentException>(
                () => testPacket = new ServiceCodePacket(action, sessionID, providerID,
                                                         fee, id, name));
        }
Exemplo n.º 2
0
        public void NullNameServiceCodePacketConstructor()
        {
            string action     = "add member";
            string sessionID  = "1234";
            float  fee        = 250;
            string id         = "123456";
            string name       = null;
            string providerID = "123456";

            ServiceCodePacket testPacket;

            Assert.ThrowsException <NullReferenceException>(
                () => testPacket = new ServiceCodePacket(action, sessionID, providerID,
                                                         fee, id, name));
        }
Exemplo n.º 3
0
        public void NegativeFeeServiceCodePacketConstructor()
        {
            string action     = "add member";
            string sessionID  = "1234";
            float  fee        = -250;
            string id         = "123456";
            string name       = "John Smith";
            string providerID = "123456";

            ServiceCodePacket testPacket;

            Assert.ThrowsException <ArgumentOutOfRangeException>(
                () => testPacket = new ServiceCodePacket(action, sessionID, providerID,
                                                         fee, id, name));
        }
Exemplo n.º 4
0
        public void ServiceCodePacketConstructor()
        {
            string action     = "add member";
            string sessionID  = "1234";
            float  fee        = 250;
            string id         = "123456";
            string name       = "John Smith";
            string providerID = "123456";

            ServiceCodePacket testPacket = new ServiceCodePacket(action, sessionID, providerID,
                                                                 fee, id, name);

            Assert.AreEqual(fee, testPacket.Fee());
            Assert.AreEqual(id, testPacket.ID());
            Assert.AreEqual(name, testPacket.Name());
        }