Esempio n. 1
0
        public void Given_Factory_When_CreateInstanceTwice_Then_MultipleInstances()
        {
            const int minimum          = 1;
            const int maximum          = 2;
            var       evaluatorFactory = new RangeCountCriteriaEvaluatorFactory(minimum, maximum);

            var evaluator  = evaluatorFactory.CreateInstance();
            var evaluator2 = evaluatorFactory.CreateInstance();

            Assert.That(evaluator, Is.Not.Null);
            Assert.That(evaluator2, Is.Not.Null);
            Assert.AreNotSame(evaluator, evaluator2);
        }
Esempio n. 2
0
        public void Given_Factory_When_CreateInstance_Then_ConfigurationPassedOn()
        {
            const int minimum          = 1;
            const int maximum          = 2;
            var       evaluatorFactory = new RangeCountCriteriaEvaluatorFactory(minimum, maximum);

            var evaluator = evaluatorFactory.CreateInstance();

            Assert.That(evaluator, Is.Not.Null);

            var typedEvaluator = evaluator as RangeCountCriteriaEvaluator;

            Assert.That(typedEvaluator, Is.Not.Null);

            Assert.That(typedEvaluator.Minimum, Is.EqualTo(minimum));
            Assert.That(typedEvaluator.Maximum, Is.EqualTo(maximum));
        }