11import GraduatedTieredPricing from "../src/GraduatedTieredPricing" ;
2+ import NumberOfSubscriptionsNotAllowed from "../src/NumberOfSubscriptionsNotAllowed" ;
23
34describe ( "Graduated tiered pricing should" , ( ) => {
5+ it ( "calculate the price for 0 subscriptions" , ( ) => {
6+ const pricing = new GraduatedTieredPricing ( ) ;
7+ expect ( pricing . priceFor ( 0 ) ) . toThrow ( NumberOfSubscriptionsNotAllowed ) ;
8+ } ) ;
9+
410 it ( "calculate the price for 1 subscription" , ( ) => {
511 const pricing = new GraduatedTieredPricing ( ) ;
612 expect ( pricing . priceFor ( 1 ) ) . toBe ( 299 ) ;
@@ -15,6 +21,26 @@ describe("Graduated tiered pricing should", () => {
1521 const pricing = new GraduatedTieredPricing ( ) ;
1622 expect ( pricing . priceFor ( 3 ) ) . toBe ( 837 ) ;
1723 } ) ;
24+
25+ it ( "calculate the price for 11 subscriptions" , ( ) => {
26+ const pricing = new GraduatedTieredPricing ( ) ;
27+ expect ( pricing . priceFor ( 11 ) ) . toBe ( 2990 ) ;
28+ } ) ;
29+
30+ it ( "calculate the price for 26 subscriptions" , ( ) => {
31+ const pricing = new GraduatedTieredPricing ( ) ;
32+ expect ( pricing . priceFor ( 26 ) ) . toBe ( 6294 ) ;
33+ } ) ;
34+
35+ it ( "calculate the price for 50 subscriptions" , ( ) => {
36+ const pricing = new GraduatedTieredPricing ( ) ;
37+ expect ( pricing . priceFor ( 50 ) ) . toBe ( 10950 ) ;
38+ } ) ;
39+
40+ it ( "calculate the price for 100 subscriptions" , ( ) => {
41+ const pricing = new GraduatedTieredPricing ( ) ;
42+ expect ( pricing . priceFor ( 100 ) ) . toBe ( 21900 ) ;
43+ } ) ;
1844} ) ;
1945
2046test ( "test framework working" , async ( ) => {
0 commit comments