lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [5691] Demonstrate and document a requirement that' s not


From: Greg Chicares
Subject: [lmi-commits] [5691] Demonstrate and document a requirement that' s not necessarily obvious
Date: Wed, 17 Apr 2013 13:13:18 +0000

Revision: 5691
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5691
Author:   chicares
Date:     2013-04-17 13:13:18 +0000 (Wed, 17 Apr 2013)
Log Message:
-----------
Demonstrate and document a requirement that's not necessarily obvious

Modified Paths:
--------------
    lmi/trunk/dbdict.hpp
    lmi/trunk/premium_tax.hpp
    lmi/trunk/premium_tax_test.cpp

Modified: lmi/trunk/dbdict.hpp
===================================================================
--- lmi/trunk/dbdict.hpp        2013-04-17 13:09:11 UTC (rev 5690)
+++ lmi/trunk/dbdict.hpp        2013-04-17 13:13:18 UTC (rev 5691)
@@ -46,6 +46,7 @@
     friend class DatabaseDocument;
     friend class input_test;        // For test_product_database().
     friend class product_file_test; // Uses InvalidateCache() for timing.
+    friend class premium_tax_test;  // For test_rates().
 
   public:
     static DBDictionary& instance();

Modified: lmi/trunk/premium_tax.hpp
===================================================================
--- lmi/trunk/premium_tax.hpp   2013-04-17 13:09:11 UTC (rev 5690)
+++ lmi/trunk/premium_tax.hpp   2013-04-17 13:13:18 UTC (rev 5691)
@@ -63,6 +63,9 @@
 /// expense covered elsewhere in pricing--and tiering is ignored, so
 /// the tax load is simply that scalar. In the second case, the exact
 /// premium tax is passed through, so the load equals the tax rate.
+/// For now, in the first case--because the '.strata' files do not yet
+/// distinguish tax loads from tax rates--the tiered premium tax must
+/// be set equal to the scalar load, for all amounts up to infinity.
 ///
 /// Known shortcomings.
 ///

Modified: lmi/trunk/premium_tax_test.cpp
===================================================================
--- lmi/trunk/premium_tax_test.cpp      2013-04-17 13:09:11 UTC (rev 5690)
+++ lmi/trunk/premium_tax_test.cpp      2013-04-17 13:13:18 UTC (rev 5691)
@@ -97,6 +97,24 @@
     BOOST_TEST_EQUAL(z.is_tiered      (), true  );
     }
 
+    // Tiered in premium-tax state, but load uniformly zero.
+    // A uniform but nonzero load elicits a runtime error, because
+    // the tiered load is not zero.
+    {
+    database_entity const original = 
DBDictionary::instance().datum("PremTaxLoad");
+    database_entity const scalar(DB_PremTaxLoad, 0.0000);
+
+    DBDictionary::instance().datum("PremTaxLoad") = scalar;
+
+    premium_tax z(mce_s_AK, mce_s_CT, false, db, strata);
+    BOOST_TEST_EQUAL(z.levy_rate      (), 0.0000);
+    BOOST_TEST_EQUAL(z.load_rate      (), 0.0000);
+    BOOST_TEST_EQUAL(z.least_load_rate(), 0.0000);
+    BOOST_TEST_EQUAL(z.is_tiered      (), true  );
+
+    DBDictionary::instance().datum("PremTaxLoad") = original;
+    }
+
     // Amortized.
     {
     premium_tax z(mce_s_CT, mce_s_MA, true , db, strata);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]