Ejemplo n.º 1
0
        public AllocationDataResult CreateAllocation(AllocationData allocation)
        {
            var allocateData = new AllocationDataResult();

            allocateData.Premium = allocation.Premium;

            allocateData.OriginalDueDate = new DateTime(2010, 1, 1);

            allocateData.Costs = new CostData();
            allocateData.Costs.MonthlyBillingFixedInternalCost        = 38;
            allocateData.Costs.BillingInternalCost                    = 55;
            allocateData.Costs.MonthlyBillingFixedRunningRemuneration = 63;
            allocateData.Costs.MonthlyBillingFixedEstablishment       = 53;
            allocateData.Costs.MonthlyBillingRegistration             = 2;

            allocateData.PremiumInternalCost  = 1;
            allocateData.PremiumRemuneration  = 2;
            allocateData.PremiumRegistration  = 332;
            allocateData.PremiumEstablishment = 14;

            allocateData.PremiumInternalCostBeforeDiscount = 57;
            allocateData.PremiumInternalCostAfterDiscount  = 37;

            allocateData.Tax = allocation.Tax;
            return(allocateData);
        }
        public void EndlessAssertsAlternative()
        {
            var allocation = new AllocationData
            {
                Premium      = 22,
                FixedCosts   = 23,
                PremiumCosts = 140,
                Tax          = 110
            };

            var sut          = new Allocator();
            var allocateData = sut.CreateAllocation(allocation);

            var printer  = TestHelper.CreateTestPrinter();
            var expected = @"new AllocationDataResult()
{
    Premium = 22
    OriginalDueDate = 01-01-2010 00:00:00
    Costs = new CostData()
    {
        MonthlyBillingFixedInternalCost = 38
        BillingInternalCost = 55
        MonthlyBillingFixedRunningRemuneration = 63
        MonthlyBillingFixedEstablishment = 53
        MonthlyBillingRegistration = 2
    }
    PremiumInternalCost = 1
    PremiumRemuneration = 2
    PremiumRegistration = 332
    PremiumEstablishment = 14
    PremiumInternalCostBeforeDiscount = 57
    PremiumInternalCostAfterDiscount = 37
    Tax = 110
}
";

            printer.Assert.PrintIsSame(expected, allocateData);
        }
        public void EndlessAssertsAlternative()
        {
            var allocation = new AllocationData
            {
                Premium = 22,
                FixedCosts = 23,
                PremiumCosts = 140,
                Tax = 110
            };

            var sut = new Allocator();
            var allocateData = sut.CreateAllocation(allocation);

            var printer = TestHelper.CreateTestPrinter();
            var expected = @"new AllocationDataResult()
            {
            Premium = 22
            OriginalDueDate = 01-01-2010 00:00:00
            Costs = new CostData()
            {
            MonthlyBillingFixedInternalCost = 38
            BillingInternalCost = 55
            MonthlyBillingFixedRunningRemuneration = 63
            MonthlyBillingFixedEstablishment = 53
            MonthlyBillingRegistration = 2
            }
            PremiumInternalCost = 1
            PremiumRemuneration = 2
            PremiumRegistration = 332
            PremiumEstablishment = 14
            PremiumInternalCostBeforeDiscount = 57
            PremiumInternalCostAfterDiscount = 37
            Tax = 110
            }";
            printer.Assert.PrintAreAlike(expected, allocateData);
        }
        public AllocationDataResult CreateAllocation(AllocationData allocation)
        {
            var allocateData = new AllocationDataResult();
            allocateData.Premium = allocation.Premium;

            allocateData.OriginalDueDate = new DateTime(2010, 1, 1);

            allocateData.Costs = new CostData();
            allocateData.Costs.MonthlyBillingFixedInternalCost = 38;
            allocateData.Costs.BillingInternalCost = 55;
            allocateData.Costs.MonthlyBillingFixedRunningRemuneration = 63;
            allocateData.Costs.MonthlyBillingFixedEstablishment = 53;
            allocateData.Costs.MonthlyBillingRegistration = 2;

            allocateData.PremiumInternalCost = 1;
            allocateData.PremiumRemuneration = 2;
            allocateData.PremiumRegistration = 332;
            allocateData.PremiumEstablishment = 14;

            allocateData.PremiumInternalCostBeforeDiscount = 57;
            allocateData.PremiumInternalCostAfterDiscount = 37;

            allocateData.Tax = allocation.Tax;
            return allocateData;
        }