private bool equalModelViews(GetDimensionModelView oneDimensionModelView, GetDimensionModelView otherDimensionModelView)
        {
            if (oneDimensionModelView == otherDimensionModelView)
            {
                return(true);
            }

            if (oneDimensionModelView == null || otherDimensionModelView == null || oneDimensionModelView.GetType() != otherDimensionModelView.GetType())
            {
                return(false);
            }

            if (oneDimensionModelView.GetType() == typeof(GetContinuousDimensionIntervalModelView))
            {
                GetContinuousDimensionIntervalModelView oneContinuousMV   = (GetContinuousDimensionIntervalModelView)oneDimensionModelView;
                GetContinuousDimensionIntervalModelView otherContinuousMV = (GetContinuousDimensionIntervalModelView)otherDimensionModelView;


                return(oneContinuousMV.minValue.Equals(otherContinuousMV.minValue) &&
                       oneContinuousMV.maxValue.Equals(otherContinuousMV.maxValue) &&
                       oneContinuousMV.increment.Equals(otherContinuousMV.increment) &&
                       oneContinuousMV.unit.Equals(otherContinuousMV.unit));
            }

            else if (oneDimensionModelView.GetType() == typeof(GetDiscreteDimensionIntervalModelView))
            {
                GetDiscreteDimensionIntervalModelView oneDiscreteMV   = (GetDiscreteDimensionIntervalModelView)oneDimensionModelView;
                GetDiscreteDimensionIntervalModelView otherDiscreteMV = (GetDiscreteDimensionIntervalModelView)otherDimensionModelView;

                var firstNotSecond = oneDiscreteMV.values.Except(otherDiscreteMV.values).ToList();
                var secondNotFirst = otherDiscreteMV.values.Except(oneDiscreteMV.values).ToList();

                bool equalLists = !firstNotSecond.Any() && !secondNotFirst.Any();

                return(equalLists && oneDiscreteMV.unit.Equals(otherDiscreteMV.unit));
            }

            else if (oneDimensionModelView.GetType() == typeof(GetSingleValueDimensionModelView))
            {
                GetSingleValueDimensionModelView oneSingleValueMV   = (GetSingleValueDimensionModelView)oneDimensionModelView;
                GetSingleValueDimensionModelView otherSingleValueMV = (GetSingleValueDimensionModelView)otherDimensionModelView;

                return(oneSingleValueMV.value.Equals(otherSingleValueMV.value) && oneSingleValueMV.unit.Equals(otherSingleValueMV.unit));
            }
            else
            {
                return(false);
            }
        }
        public void ensureFromEntityConvertsToGetSingleValueDimensionModelViewIfProvidedDimensionIsSingleValue()
        {
            Dimension singleValueDimension = new SingleValueDimension(15);

            GetDimensionModelView getDimensionModelView = DimensionModelViewService.fromEntity(singleValueDimension);

            Type expectedDimensionType = typeof(GetSingleValueDimensionModelView);

            Assert.Equal(expectedDimensionType, getDimensionModelView.GetType());
        }
        public void ensureFromEntityConvertsToGetDiscreteDimensionIntervalModelViewIfProvidedDimensionIsDiscreteInterval()
        {
            Dimension discreteDimensionInterval = new DiscreteDimensionInterval(new List <double>()
            {
                21, 35, 42
            });

            GetDimensionModelView getDimensionModelView = DimensionModelViewService.fromEntity(discreteDimensionInterval);

            Type expectedDimensionType = typeof(GetDiscreteDimensionIntervalModelView);

            Assert.Equal(expectedDimensionType, getDimensionModelView.GetType());
        }
        public void ensureFromEntityConvertsToGetContinuousDimensionIntervalModelViewIfProvidedDimensionIsContinuousInterval()
        {
            double minValue  = 20;
            double maxValue  = 60;
            double increment = 2;

            Dimension continuousDimensionInterval = new ContinuousDimensionInterval(minValue, maxValue, increment);

            GetDimensionModelView getDimensionModelView = DimensionModelViewService.fromEntity(continuousDimensionInterval);

            Type expectedDimensionType = typeof(GetContinuousDimensionIntervalModelView);

            Assert.Equal(expectedDimensionType, getDimensionModelView.GetType());
        }
        public void ensureFromEntityWithUnitConvertsToGetContinuousDimensionIntervalModelViewIfProvidedDimensionIsContinuousInterval()
        {
            Dimension continuousDimensionInterval = new ContinuousDimensionInterval(
                minValue: 20,
                maxValue: 60,
                increment: 2
                );

            string unit = "dm";

            GetDimensionModelView getDimensionModelView = DimensionModelViewService.fromEntity(continuousDimensionInterval, unit);

            Type expectedDimensionType = typeof(GetContinuousDimensionIntervalModelView);

            Assert.Equal(expectedDimensionType, getDimensionModelView.GetType());
        }