public void Read_ValidEntityWithStochasts_ReturnsGeneralResultFaultTreeIllustrationPoint()
        {
            // Setup
            var random = new Random(21);

            var entity = new GeneralResultFaultTreeIllustrationPointEntity
            {
                GoverningWindDirectionName  = "SSE",
                GoverningWindDirectionAngle = random.NextDouble(),
                StochastEntities            = new[]
                {
                    new StochastEntity
                    {
                        Name     = "stochastEntityOne",
                        Duration = random.NextDouble(),
                        Alpha    = random.NextDouble(),
                        Order    = 0
                    },
                    new StochastEntity
                    {
                        Name     = "stochastEntityTwo",
                        Duration = random.NextDouble(),
                        Alpha    = random.NextDouble(),
                        Order    = 1
                    }
                }
            };

            // Call
            GeneralResult <TopLevelFaultTreeIllustrationPoint> generalResult = entity.Read();

            // Assert
            AssertWindDirection(entity, generalResult.GoverningWindDirection);
            AssertStochasts(entity.StochastEntities.ToArray(), generalResult.Stochasts.ToArray());
        }
        public void Read_ValidEntityWithIllustrationPoints_ReturnsGeneralResultFaultTreeIllustrationPoint()
        {
            // Setup
            var random = new Random(210);

            var topLevelFaultTreeIllustrationPointEntities = new[]
            {
                new TopLevelFaultTreeIllustrationPointEntity
                {
                    WindDirectionName  = "WindDirectionOne",
                    WindDirectionAngle = random.NextDouble(),
                    ClosingSituation   = "ClosingSituationOne",
                    FaultTreeIllustrationPointEntity = new FaultTreeIllustrationPointEntity
                    {
                        Beta            = random.NextDouble(),
                        CombinationType = Convert.ToByte(random.NextEnumValue <CombinationType>()),
                        Name            = "IllustrationPointOne"
                    },
                    Order = 0
                },
                new TopLevelFaultTreeIllustrationPointEntity
                {
                    WindDirectionName  = "WindDirectionTwo",
                    WindDirectionAngle = random.NextDouble(),
                    ClosingSituation   = "ClosingSituationTwo",
                    FaultTreeIllustrationPointEntity = new FaultTreeIllustrationPointEntity
                    {
                        Beta            = random.NextDouble(),
                        CombinationType = Convert.ToByte(random.NextEnumValue <CombinationType>()),
                        Name            = "IllustrationPointTwo"
                    },
                    Order = 1
                }
            };

            var entity = new GeneralResultFaultTreeIllustrationPointEntity
            {
                GoverningWindDirectionName  = "SSE",
                GoverningWindDirectionAngle = random.NextDouble(),
                TopLevelFaultTreeIllustrationPointEntities = topLevelFaultTreeIllustrationPointEntities
            };

            // Call
            GeneralResult <TopLevelFaultTreeIllustrationPoint> generalResult = entity.Read();

            // Assert
            AssertWindDirection(entity, generalResult.GoverningWindDirection);
            AssertIllustrationPoints(entity.TopLevelFaultTreeIllustrationPointEntities.ToArray(),
                                     generalResult.TopLevelIllustrationPoints.ToArray());
        }
        public void Read_ValidEntity_ReturnsGeneralResult()
        {
            // Setup
            var entity = new GeneralResultFaultTreeIllustrationPointEntity
            {
                GoverningWindDirectionName  = "SSE",
                GoverningWindDirectionAngle = new Random(213).NextDouble()
            };

            // Call
            GeneralResult <TopLevelFaultTreeIllustrationPoint> generalResult = entity.Read();

            // Assert
            AssertWindDirection(entity, generalResult.GoverningWindDirection);
            CollectionAssert.IsEmpty(generalResult.Stochasts);
            CollectionAssert.IsEmpty(generalResult.TopLevelIllustrationPoints);
        }