Ejemplo n.º 1
0
        public static void ClassInitialize(TestContext context)
        {
            dbfcMock = new Mock <IDbFieldsConstraints>();
            DependencyInjector.Register(dbfcMock.Object).As <IDbFieldsConstraints>();

            DummyConstraints dc = new DummyConstraints();

            dc.StringSingleConstraints("UserAuthentications", "CallerId", 255, true, 1);
            dbfcMock.Setup(x => x.Constraints).Returns(dc.GetConstraints());
        }
        public static void ClassInitialize(TestContext context)
        {
            dbfcMock = new Mock <IDbFieldsConstraints>();
            DependencyInjector.Register(dbfcMock.Object).As <IDbFieldsConstraints>();

            DummyConstraints dc = new DummyConstraints();

            dc.StringSingleConstraints("UserAuthentications", "CallerId", 255, true, 1);
            dbfcMock.Setup(x => x.Constraints).Returns(dc.GetConstraints());

            dbdcMock = new Mock <IIdeaDatabaseDataContext>();
            DependencyInjector.Register(dbdcMock.Object).As <IIdeaDatabaseDataContext>();

            queryUtilsMock = new Mock <IQueryUtils>();
            DependencyInjector.Register(queryUtilsMock.Object).As <IQueryUtils>();

            queryUtilsMock.Setup(x => x.GetHPPToken(It.IsAny <IIdeaDatabaseDataContext>(),
                                                    It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>()))
            .Returns(new UserAuthentication()
            {
                Token = "ReturnedToken"
            });
        }