[ { "name": "65% claims and 30% expenses make a 95% combined ratio", "args": [ { "minor": 100000000, "currency": "GBP" }, { "minor": 65000000, "currency": "GBP" }, { "minor": 30000000, "currency": "GBP" }, "half-up" ], "expect": { "lossRatioBasisPoints": 6500, "expenseRatioBasisPoints": 3000, "combinedRatioBasisPoints": 9500 } }, { "name": "the combined ratio is rounded once: 33.33% and 33.33% but 66.67% together", "args": [ { "minor": 300, "currency": "GBP" }, { "minor": 100, "currency": "GBP" }, { "minor": 100, "currency": "GBP" }, "half-up" ], "expect": { "lossRatioBasisPoints": 3333, "expenseRatioBasisPoints": 3333, "combinedRatioBasisPoints": 6667 } }, { "name": "the same rounded down", "args": [ { "minor": 300, "currency": "GBP" }, { "minor": 100, "currency": "GBP" }, { "minor": 100, "currency": "GBP" }, "down" ], "expect": { "lossRatioBasisPoints": 3333, "expenseRatioBasisPoints": 3333, "combinedRatioBasisPoints": 6666 } }, { "name": "an underwriting loss: combined above 100%", "args": [ { "minor": 100000, "currency": "GBP" }, { "minor": 120000, "currency": "GBP" }, { "minor": 25000, "currency": "GBP" }, "half-up" ], "expect": { "lossRatioBasisPoints": 12000, "expenseRatioBasisPoints": 2500, "combinedRatioBasisPoints": 14500 } }, { "name": "no claims", "args": [ { "minor": 100000, "currency": "GBP" }, { "minor": 0, "currency": "GBP" }, { "minor": 30000, "currency": "GBP" }, "half-up" ], "expect": { "lossRatioBasisPoints": 0, "expenseRatioBasisPoints": 3000, "combinedRatioBasisPoints": 3000 } }, { "name": "reserve releases outweighing new claims give a negative loss ratio", "args": [ { "minor": 100000, "currency": "GBP" }, { "minor": -5000, "currency": "GBP" }, { "minor": 30000, "currency": "GBP" }, "half-up" ], "expect": { "lossRatioBasisPoints": -500, "expenseRatioBasisPoints": 3000, "combinedRatioBasisPoints": 2500 } }, { "name": "half a basis point rounds to even", "args": [ { "minor": 20000, "currency": "GBP" }, { "minor": 1, "currency": "GBP" }, { "minor": 0, "currency": "GBP" }, "half-even" ], "expect": { "lossRatioBasisPoints": 0, "expenseRatioBasisPoints": 0, "combinedRatioBasisPoints": 0 } }, { "name": "half a basis point rounds up half-up", "args": [ { "minor": 20000, "currency": "GBP" }, { "minor": 1, "currency": "GBP" }, { "minor": 0, "currency": "GBP" }, "half-up" ], "expect": { "lossRatioBasisPoints": 1, "expenseRatioBasisPoints": 0, "combinedRatioBasisPoints": 1 } }, { "name": "a negative half rounds away from zero half-up", "args": [ { "minor": 20000, "currency": "GBP" }, { "minor": -1, "currency": "GBP" }, { "minor": 0, "currency": "GBP" }, "half-up" ], "expect": { "lossRatioBasisPoints": -1, "expenseRatioBasisPoints": 0, "combinedRatioBasisPoints": -1 } }, { "name": "no earned premium is refused", "args": [ { "minor": 0, "currency": "GBP" }, { "minor": 100, "currency": "GBP" }, { "minor": 0, "currency": "GBP" }, "half-up" ], "expectError": "earnedPremium must be more than zero" }, { "name": "negative earned premium is refused", "args": [ { "minor": -100, "currency": "GBP" }, { "minor": 100, "currency": "GBP" }, { "minor": 0, "currency": "GBP" }, "half-up" ], "expectError": "earnedPremium must be more than zero" }, { "name": "claims in another currency are refused", "args": [ { "minor": 100, "currency": "GBP" }, { "minor": 100, "currency": "EUR" }, { "minor": 0, "currency": "GBP" }, "half-up" ], "expectError": "currency mismatch" } ]