Ejemplo n.º 1
0
        public void Test_EventsAreCreated_When_MultipleInputsAreProvided()
        {
            var input = new[] { new[] { 3, 3, 3, 750 }, new[] { 2, 2, 1, 1000 } };

            var events = EventEnricher.GetEnrichedEvents(input);

            Assert.AreEqual(events.Count, 2);
        }
Ejemplo n.º 2
0
        public void Test_NoEventIsCreated_When_PerilAndRegionValuesAreNotInTheEnum()
        {
            var input = new[] { new[] { 3, 4, 4, 750 } };

            var events = EventEnricher.GetEnrichedEvents(input);

            Assert.AreEqual(events.Count, 0);
        }
Ejemplo n.º 3
0
        public void Test_NoEventIsCreated_When_InputIsGreaterThan4()
        {
            var input = new[] { new[] { 3, 3, 3, 750, 88 } };

            var events = EventEnricher.GetEnrichedEvents(input);

            Assert.AreEqual(events.Count, 0);
        }
Ejemplo n.º 4
0
        public void Test_EventIsCreated_When_InputIsAsExpectedForAnEvent()
        {
            var input = new[] { new[] { 3, 3, 3, 750 } };

            var events = EventEnricher.GetEnrichedEvents(input);

            Assert.AreEqual(events.Count, 1);
            var e = events.FirstOrDefault();

            Assert.AreEqual(e.Id, 3);
            Assert.AreEqual(e.Peril, Peril.Flood);
            Assert.AreEqual(e.Region, Region.Florida);
            Assert.AreEqual(e.EventLoss, 750);
        }
Ejemplo n.º 5
0
        public static void Main(string[] args)
        {
            var events = EventEnricher.GetEnrichedEvents(Data.Events);
            var deals  = DealLoader.GetDeals();


            deals.ForEach(d => Console.WriteLine(d));
            Console.WriteLine();
            Console.WriteLine();
            events.ForEach(d => Console.WriteLine(d));

            Evaluator.Instance.EvaluateLoss(deals, events);

            Console.WriteLine();
            Console.WriteLine();

            events.OrderBy(e => e.Id);
            events.ForEach(o => Console.WriteLine(o.PrintReinsuranceTotalLoss()));

            Console.ReadLine();
        }
Ejemplo n.º 6
0
        public void Test_NoEventIsCreated_When_InputIsEmptyArray()
        {
            var events = EventEnricher.GetEnrichedEvents(new int[0][]);

            Assert.AreEqual(events.Count, 0);
        }
Ejemplo n.º 7
0
        public void Test_NoEventIsCreated_When_InputIsNUll()
        {
            var events = EventEnricher.GetEnrichedEvents(null);

            Assert.AreEqual(events.Count, 0);
        }