コード例 #1
0
        public void Add(ICubeValue cubeValue)
        {
            var otherValue = cubeValue as LongValue;

            if (otherValue == null)
            {
                throw new InvalidOperationException($"Unable to add value of type '{cubeValue.GetType()}'");
            }

            this.Value += otherValue.Value;
        }
コード例 #2
0
        public void Add(ICubeValue cubeValue)
        {
            if (cubeValue == null)
            {
                throw new ArgumentNullException(nameof(cubeValue));
            }

            if (!(cubeValue is ValueDouble cubeValueAsValueDouble))
            {
                throw new InvalidOperationException($"Unable to add a non-ValueDouble instance to this. Added type -{cubeValue.GetType().Name}");
            }

            this.Value += cubeValueAsValueDouble.Value;
        }
コード例 #3
0
ファイル: CubeTests.cs プロジェクト: borsuksoftware/datacube
            public void Add(ICubeValue cubeValue)
            {
                if (cubeValue == null)
                {
                    return;
                }

                var other = cubeValue as CubeValueDouble;

                if (other == null)
                {
                    throw new NotSupportedException();
                }

                this.Val += other.Val;
            }