Ejemplo n.º 1
0
        public void SetUp()
        {
            _componentEvaluator1 = new MockComponentEvaluator(TimeSpan.FromMilliseconds(1000), null);

            _criteriaEvaluator1 = A.Fake <IExpectationCriteriaEvaluator>();
            A.CallTo(() => _criteriaEvaluator1.Met).Returns(true);

            _criteriaFactory1 = A.Fake <IExpectationCriteriaEvaluatorFactory>();
            A.CallTo(() => _criteriaFactory1.CreateInstance()).Returns(_criteriaEvaluator1);

            _expectation1 = new ExpectationEvaluator(
                TimeSpan.FromMilliseconds(500),
                _componentEvaluator1,
                new List <Func <IAsyncEnumerable <ConditionInstance>, IAsyncEnumerable <ConditionInstance> > >(),
                _criteriaFactory1);


            _componentEvaluator2 = new MockComponentEvaluator(TimeSpan.FromMilliseconds(1000), null);

            _criteriaEvaluator2 = A.Fake <IExpectationCriteriaEvaluator>();
            A.CallTo(() => _criteriaEvaluator2.Met).Returns(true);

            _criteriaFactory2 = A.Fake <IExpectationCriteriaEvaluatorFactory>();
            A.CallTo(() => _criteriaFactory2.CreateInstance()).Returns(_criteriaEvaluator2);

            _expectation2 = new ExpectationEvaluator(
                TimeSpan.FromMilliseconds(500),
                _componentEvaluator2,
                new List <Func <IAsyncEnumerable <ConditionInstance>, IAsyncEnumerable <ConditionInstance> > >(),
                _criteriaFactory2);
        }
Ejemplo n.º 2
0
 public void TearDown()
 {
     _componentEvaluator = null;
     _criteriaEvaluator  = null;
     _criteriaFactory    = null;
     _sut = null;
 }
Ejemplo n.º 3
0
 public ExpectationEvaluator(
     TimeSpan timeout,
     IComponentConditionEvaluator componentConditionEvaluator,
     List <Func <IAsyncEnumerable <ConditionInstance>, IAsyncEnumerable <ConditionInstance> > > filters,
     IExpectationCriteriaEvaluatorFactory criteria,
     string description = "")
 {
     Timeout = timeout;
     _componentConditionEvaluator = componentConditionEvaluator;
     _filters    = filters;
     _criteria   = criteria;
     Description = description;
 }
Ejemplo n.º 4
0
        public void SetUp()
        {
            _componentEvaluator = new MockComponentEvaluator(TimeSpan.FromMilliseconds(50), 1);

            _criteriaEvaluator = A.Fake <IExpectationCriteriaEvaluator>();
            A.CallTo(() => _criteriaEvaluator.Met).Returns(true);

            _criteriaFactory = A.Fake <IExpectationCriteriaEvaluatorFactory>();
            A.CallTo(() => _criteriaFactory.CreateInstance()).Returns(_criteriaEvaluator);

            _sut = new ExpectationEvaluator(
                TimeSpan.FromMilliseconds(100),
                _componentEvaluator,
                new List <Func <IAsyncEnumerable <ConditionInstance>, IAsyncEnumerable <ConditionInstance> > >(),
                _criteriaFactory);
        }
        public void InitialSetup()
        {
            _verifierTimeout = TimeSpan.FromMilliseconds(500);

            _filterSpec = A.Fake <IExpectationFilterSpecification>();
            A.CallTo(() => _filterSpec.Description).Returns(FilterDescription);

            _criteria        = A.Fake <IExpectationCriteriaEvaluator>();
            _criteriaFactory = A.Fake <IExpectationCriteriaEvaluatorFactory>();
            A.CallTo(() => _criteriaFactory.CreateInstance()).Returns(_criteria);

            _criteriaSpec = A.Fake <IExpectationCriteriaSpecification>();
            A.CallTo(() => _criteriaSpec.Build()).Returns(_criteriaFactory);
            A.CallTo(() => _criteriaSpec.Timeout).Returns(TimeSpan.FromMilliseconds(500));
            A.CallTo(() => _criteriaSpec.Description).Returns(CriteriaDescription);

            _componentEvaluator = new MockComponentEvaluator(TimeSpan.FromMilliseconds(50), 8);
        }