Пример #1
0
        public void Composite_Specification()
        {
            var spec = new IntegerComposite();
            var composite = spec.GetComposite();

            Assert.That(composite, Is.TypeOf<Conjunction<int>>());
            Assert.That(composite, Has.Property("Left").TypeOf<Disjunction<int>>());
            Assert.That(composite, Has.Property("Left").With.Property("Left").TypeOf<IntegerGreaterThanZero>());
            Assert.That(composite, Has.Property("Left").With.Property("Right").TypeOf<IntegerEqualToZero>());
            Assert.That(composite, Has.Property("Right").TypeOf<Negation<int>>());
            Assert.That(composite, Has.Property("Right").With.Property("Inner").TypeOf<IntegerLessThanZero>());
        }