Class ShippingRuleTest
java.lang.Object
test.ShippingRuleTest
Provides test cases for the
ShippingRule
class.
Tests the matching of packets to shipping rules based on the dimensions and weight of the packet. The tests ensure that packets that match the rule are correctly identified as a match and packets that do not match the rule are correctly identified as not a match.
Contains the following test cases:
-
testMatches_ValidPacket_MatchesRule()
- Tests that a packet with dimensions and weight that are clearly below the rule is correctly identified as a match. -
testMatches_ValidLimitPacket_MatchesRule()
- Tests that a packet with dimension and weight at the limit of the rule is correctly identified as a match. -
testMatches_InvalidPacket_DimensionsExceed()
- Tests that a packet with dimensions that exceed the rule is correctly identified as not a match. -
testMatches_InvalidPacket_WeightExceeds()
- Tests that a packet with weight that exceeds the rule is correctly identified as not a match. -
testMatches_InvalidPacket_GirthExceeds()
- Tests that a packet with girth that exceeds the rule (with girth limit) is correctly identified as not a match. -
testMatches_InvalidPacket_NullPacket()
- Tests that a null-packet throws a NullPointerException.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Tests that a packet with dimensions that exceed the rule is correctly identified as not a match.void
Tests that a packet with girth that exceeds the rule (with girth limit) is correctly identified as not a match.void
Tests that a null-packet throws a NullPointerException.void
Tests that a packet with weight that exceeds the rule is correctly identified as not a match.void
Tests that a packet with dimension and weight at the limit of the rule is correctly identified as a match.void
Tests that a packet with dimensions and weight that are clearly below the rule is correctly identified as a match.
-
Constructor Details
-
ShippingRuleTest
public ShippingRuleTest()
-
-
Method Details
-
testMatches_ValidPacket_MatchesRule
@Test public void testMatches_ValidPacket_MatchesRule()Tests that a packet with dimensions and weight that are clearly below the rule is correctly identified as a match. -
testMatches_ValidLimitPacket_MatchesRule
@Test public void testMatches_ValidLimitPacket_MatchesRule()Tests that a packet with dimension and weight at the limit of the rule is correctly identified as a match. -
testMatches_InvalidPacket_DimensionsExceed
@Test public void testMatches_InvalidPacket_DimensionsExceed()Tests that a packet with dimensions that exceed the rule is correctly identified as not a match. -
testMatches_InvalidPacket_WeightExceeds
@Test public void testMatches_InvalidPacket_WeightExceeds()Tests that a packet with weight that exceeds the rule is correctly identified as not a match. -
testMatches_InvalidPacket_GirthExceeds
@Test public void testMatches_InvalidPacket_GirthExceeds()Tests that a packet with girth that exceeds the rule (with girth limit) is correctly identified as not a match. -
testMatches_InvalidPacket_NullPacket
@Test public void testMatches_InvalidPacket_NullPacket()Tests that a null-packet throws a NullPointerException.
-