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)); }
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)); }
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)); }
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()); }