Exemplo n.º 1
0
        public void CalculateBaseSetCorrectlyAggregatesValuesThatArePartlyZero()
        {
            var values = new NodeValue?[] { new NodeValue(-42, 0), new NodeValue(0, 5), new NodeValue(0) };

            var actual = NodeValueAggregators.CalculateBaseSet(values);

            Assert.AreEqual(new NodeValue(-42, 5), actual);
        }
Exemplo n.º 2
0
        public void CalculateBaseSetThrowsExceptionIfNoValueIsZero()
        {
            var values = new List <NodeValue?> {
                new NodeValue(0, 5), new NodeValue(0, 44)
            };

            Assert.Throws <NotSupportedException>(() => NodeValueAggregators.CalculateBaseSet(values));
        }
Exemplo n.º 3
0
        public void CalculateBaseSetThrowsExceptionIfMultipleValuesWithNonUZeroMaximumArePassed()
        {
            var values = new NodeValue?[] { new NodeValue(0, 5), new NodeValue(0, 44) };

            Assert.Throws <NotSupportedException>(() => NodeValueAggregators.CalculateBaseSet(values));
        }
Exemplo n.º 4
0
        public void CalculateBaseSetThrowsExceptionIfMultipleNonZeroValuesArePassed()
        {
            var values = new double?[] { 42, 0, 43 }.Select(v => (NodeValue?)v);

            Assert.Throws <NotSupportedException>(() => NodeValueAggregators.CalculateBaseSet(values));
        }
Exemplo n.º 5
0
        public void CalculateOverrideThrowsExceptionIfNoValueIsZero()
        {
            var values = new double?[] { 42, 43, null, 4, -3 }.Select(v => (NodeValue?)v);

            Assert.Throws <NotSupportedException>(() => NodeValueAggregators.CalculateOverride(values));
        }