protected override void Given()
        {
            lhs = MockRepository.GenerateStub<IBerkeleyQuery>();

            lhsSet = new[] {new InternalId(Guid.NewGuid()), new InternalId(Guid.NewGuid())};

            lhs.Stub(_ => _.Execute(null)).IgnoreArguments().Return(lhsSet);
            lhs.Stub(_ => _.ExecuteInsideIntersect(null, null)).IgnoreArguments().Return(lhsSet);

            sut = new IntersectOperator(new[] {lhs});
        }
        protected override void Given()
        {
            lhs = MockRepository.GenerateStub<IBerkeleyQuery>();
            rhs = MockRepository.GenerateStub<IBerkeleyQuery>();

            commonGuid = new InternalId(Guid.NewGuid());
            lhsSet = new[] {commonGuid, new InternalId(Guid.NewGuid())};
            rhsSet = new[] {new InternalId(Guid.NewGuid()), commonGuid};

            //A bit weak. We're not sure which side will execute first: The second to execute
            //will call ExecuteInsideIntersect. Cheat by ignoring this and having the pair of methods
            //return the same result.
            lhs.Stub(_ => _.Execute(null)).IgnoreArguments().Return(lhsSet);
            lhs.Stub(_ => _.ExecuteInsideIntersect(null, null)).IgnoreArguments().Return(lhsSet);
            rhs.Stub(_ => _.Execute(null)).IgnoreArguments().Return(rhsSet);
            rhs.Stub(_ => _.ExecuteInsideIntersect(null, null)).IgnoreArguments().Return(rhsSet);

            sut = new IntersectOperator(new[] {lhs, rhs});
        }
Ejemplo n.º 3
0
        protected override void Given()
        {
            lhs = MockRepository.GenerateStub<IBerkeleyQuery>();
            rhs = MockRepository.GenerateStub<IBerkeleyQuery>();

            var commonGuid = new InternalId(Guid.NewGuid());
            lhsSet = new[] {commonGuid, new InternalId(Guid.NewGuid())};
            rhsSet = new[] {new InternalId(Guid.NewGuid()), commonGuid};

            lhs.Stub(_ => _.Execute(null)).IgnoreArguments().Return(lhsSet);
            rhs.Stub(_ => _.Execute(null)).IgnoreArguments().Return(rhsSet);

            sut = new UnionOperator(new[] {lhs, rhs});
        }