コード例 #1
0
    public void setup()
    {
        List <ParameterGetal> dateParameterGetallen = new List <ParameterGetal>
        {
            new ParameterGetal {
                ID = 29, parameter = "Datum", parameterwaarde = string.Format("{0:dd/MM/yyyy}", DateTime.Today.AddDays(-1))
            }
        };
        List <ParameterGetal> tellerParameterGetallen = new List <ParameterGetal>
        {
            new ParameterGetal {
                ID = 3, parameter = "orderteller", parameterwaarde = "4"
            }
        };
        IQueryFluent <ParameterGetal>     datefluent               = MockRepository.GenerateStub <IQueryFluent <ParameterGetal> >();
        IQueryFluent <ParameterGetal>     tellerfluent             = MockRepository.GenerateStub <IQueryFluent <ParameterGetal> >();
        IRepositoryAsync <ParameterGetal> parametergetalrepository = MockRepository.GenerateStub <IRepositoryAsync <ParameterGetal> >();

        _unitOfWork = MockRepository.GenerateStub <IUnitOfWorkAsync>();
        _unitOfWork.Stub(u => u.RepositoryAsync <ParameterGetal>())
        .Return(parametergetalrepository);
        parametergetalrepository.Stub(r => r.Query(ReferentieBuilder.DatumExpression))
        .Return(datefluent);
        parametergetalrepository.Stub(r => r.Query(ReferentieBuilder.OrderTellerExpression))
        .Return(tellerfluent);
        datefluent.Stub(q => q.Select())
        .Return(dateParameterGetallen);
        tellerfluent.Stub(q => q.Select())
        .Return(tellerParameterGetallen);
    }
コード例 #2
0
    public void setup()
    {
        List <ParameterGetal> dateParameterGetallen = new List <ParameterGetal>
        {
            new ParameterGetal {
                ID = 29, parameter = "Datum", parameterwaarde = string.Format("{0:dd/MM/yyyy}", DateTime.Today.AddDays(-1))
            }
        };
        List <ParameterGetal> tellerParameterGetallen = new List <ParameterGetal>
        {
            new ParameterGetal {
                ID = 3, parameter = "orderteller", parameterwaarde = "4"
            }
        };
        IQueryFluent <ParameterGetal>     datefluent               = MockRepository.GenerateStub <IQueryFluent <ParameterGetal> >();
        IQueryFluent <ParameterGetal>     tellerfluent             = MockRepository.GenerateStub <IQueryFluent <ParameterGetal> >();
        IRepositoryAsync <ParameterGetal> parametergetalrepository = MockRepository.GenerateStub <IRepositoryAsync <ParameterGetal> >();

        _unitOfWork = MockRepository.GenerateStub <IUnitOfWorkAsync>();
        _unitOfWork.Stub(u => u.RepositoryAsync <ParameterGetal>())
        .Return(parametergetalrepository);
        parametergetalrepository.Stub(r => r.Query(Arg <Expression <Func <ParameterGetal, bool> > > .Matches(a => LambdaCompare.Eq(a, o => o.parameter == "Datum"))))
        .Return(datefluent);
        parametergetalrepository.Stub(r => r.Query(Arg <Expression <Func <ParameterGetal, bool> > > .Matches(a => LambdaCompare.Eq(a, o => o.parameter == "orderteller"))))
        .Return(tellerfluent);
        datefluent.Stub(q => q.Select())
        .Return(dateParameterGetallen);
        tellerfluent.Stub(q => q.Select())
        .Return(tellerParameterGetallen);
    }