Exemplo n.º 1
0
        public void TestGetCumulativeDataTriangle5()
        {
            var productIncrementalValue1 = CreateProductIncrementalValue("Non - Comp", 1995, 1995, 100);
            var productIncrementalValue2 = CreateProductIncrementalValue("Non - Comp", 1995, 1996, 50);
            var productIncrementalValue3 = CreateProductIncrementalValue("Non - Comp", 1995, 1997, 200);

            var productIncrementalValue4 = CreateProductIncrementalValue("Non - Comp", 1996, 1996, 80.0);
            var productIncrementalValue5 = CreateProductIncrementalValue("Non - Comp", 1996, 1997, 40.0);
            var productIncrementalValue6 = CreateProductIncrementalValue("Non - Comp", 1997, 1997, 120.0);

            var expectedCumulativeTriange = new List <double>()
            {
                100, 150, 350, 80, 120, 120
            };
            var product = CreateProduct("Non - Comp", 1995, 3,
                                        new List <ProductIncrementalValue>()
            {
                productIncrementalValue1,
                productIncrementalValue2,
                productIncrementalValue3,
                productIncrementalValue4,
                productIncrementalValue5,
                productIncrementalValue6
            });

            CumulativeDataCalculator cumulativeDataTriangle = new CumulativeDataCalculator();

            CollectionAssert.AreEqual(expectedCumulativeTriange, cumulativeDataTriangle.Calculate(product));
        }
Exemplo n.º 2
0
        public void TestGetCumulativeDataTriangle4()
        {
            var productIncrementalValue1 = CreateProductIncrementalValue("Non - Comp", 1990, 1990, 45.2);
            var productIncrementalValue2 = CreateProductIncrementalValue("Non - Comp", 1990, 1991, 64.8);
            var productIncrementalValue3 = CreateProductIncrementalValue("Non - Comp", 1990, 1993, 37.0);

            var productIncrementalValue4 = CreateProductIncrementalValue("Non - Comp", 1991, 1991, 50.0);
            var productIncrementalValue5 = CreateProductIncrementalValue("Non - Comp", 1991, 1992, 75.0);
            var productIncrementalValue6 = CreateProductIncrementalValue("Non - Comp", 1991, 1993, 25.0);

            var productIncrementalValue7 = CreateProductIncrementalValue("Non - Comp", 1992, 1992, 55.0);
            var productIncrementalValue8 = CreateProductIncrementalValue("Non - Comp", 1992, 1993, 85.0);
            var productIncrementalValue9 = CreateProductIncrementalValue("Non - Comp", 1993, 1993, 100.0);

            var expectedCumulativeTriange = new List <double>()
            {
                45.2, 110, 110, 147, 50, 125, 150, 55, 140, 100
            };
            var product = CreateProduct("Non - Comp", 1990, 4,
                                        new List <ProductIncrementalValue>()
            {
                productIncrementalValue1,
                productIncrementalValue2,
                productIncrementalValue3,
                productIncrementalValue4,
                productIncrementalValue5,
                productIncrementalValue6,
                productIncrementalValue7,
                productIncrementalValue8,
                productIncrementalValue9
            });
            CumulativeDataCalculator cumulativeDataTriangle = new CumulativeDataCalculator();

            CollectionAssert.AreEqual(expectedCumulativeTriange, cumulativeDataTriangle.Calculate(product));
        }
Exemplo n.º 3
0
        public void TestGetCumulativeDataTriangle_EmptyIncrementalData_ReturnsEmptyList()
        {
            var product = CreateProduct("Comp", 1990, 4, new List <ProductIncrementalValue>());
            CumulativeDataCalculator cumulativeDataTriangle = new CumulativeDataCalculator();

            Assert.IsEmpty(cumulativeDataTriangle.Calculate(product));
        }
Exemplo n.º 4
0
        public void TestGetCumulativeDataTriangle2()
        {
            var productIncrementalValue   = CreateProductIncrementalValue("Comp", 1993, 1993, 45.2);
            var expectedCumulativeTriange = new List <double>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 45.2
            };
            var product = CreateProduct("Comp", 1990, 4, new List <ProductIncrementalValue>()
            {
                productIncrementalValue
            });
            CumulativeDataCalculator cumulativeDataTriangle = new CumulativeDataCalculator();

            CollectionAssert.AreEqual(expectedCumulativeTriange, cumulativeDataTriangle.Calculate(product));
        }
Exemplo n.º 5
0
        public void TestGetCumulativeDataTriangle3()
        {
            var productIncrementalValue1 = CreateProductIncrementalValue("Comp", 1992, 1992, 110.0);
            var productIncrementalValue2 = CreateProductIncrementalValue("Comp", 1992, 1993, 170.0);
            var productIncrementalValue3 = CreateProductIncrementalValue("Comp", 1993, 1993, 200.0);

            var expectedCumulativeTriange = new List <double>()
            {
                0, 0, 0, 0, 0, 0, 0, 110, 280, 200
            };
            var product = CreateProduct("Comp", 1990, 4,
                                        new List <ProductIncrementalValue>()
            {
                productIncrementalValue1,
                productIncrementalValue2,
                productIncrementalValue3
            });
            CumulativeDataCalculator cumulativeDataTriangle = new CumulativeDataCalculator();

            CollectionAssert.AreEqual(expectedCumulativeTriange, cumulativeDataTriangle.Calculate(product));
        }