Esempio n. 1
0
        public void GetInverse_ReturnValueHasTypeUnionExpression()
        {
            var union = new UnionExpressionTest(new List<IExpression>(), _randomGenerator);

            var result = union.GetInverse();

            Assert.IsInstanceOf<IntersectionExpression>(result);
        }
Esempio n. 2
0
        public void GetInverse_ReturnValueHasSameRepeatIntegerIntervalAsOriginal()
        {
            var repeatRange = new IntegerInterval();
            repeatRange.TrySetValue(1, 2);
            var union = new UnionExpressionTest(new List<IExpression>(), _randomGenerator) {RepeatRange = repeatRange};

            var result = union.GetInverse().RepeatRange;

            Assert.AreEqual(repeatRange, result);
        }
Esempio n. 3
0
        public void GetInverse_CallsGetComplementOnEachUnionElement()
        {
            var expression1 = Substitute.For<IExpression>();
            var expression2 = Substitute.For<IExpression>();
            var unionExpressions = new List<IExpression> {expression1, expression2};
            var union = new UnionExpressionTest(unionExpressions, _randomGenerator);

            union.GetInverse();

            expression1.Received(1).GetInverse();
            expression2.Received(1).GetInverse();
        }