Beispiel #1
0
        public AppGrainTests()
        {
            A.CallTo(() => user.Id)
            .Returns(contributorId);

            A.CallTo(() => userResolver.FindByIdOrEmailAsync(contributorId))
            .Returns(user);

            A.CallTo(() => appPlansProvider.GetFreePlan())
            .Returns(new ConfigAppLimitsPlan {
                Id = planIdFree, MaxContributors = 10
            });

            A.CallTo(() => appPlansProvider.GetPlan(planIdFree))
            .Returns(new ConfigAppLimitsPlan {
                Id = planIdFree, MaxContributors = 10
            });

            A.CallTo(() => appPlansProvider.GetPlan(planIdPaid))
            .Returns(new ConfigAppLimitsPlan {
                Id = planIdPaid, MaxContributors = 30
            });

            initialPatterns = new InitialPatterns
            {
                { patternId1, new AppPattern("Number", "[0-9]") },
                { patternId2, new AppPattern("Numbers", "[0-9]*") }
            };

            sut = new AppGrain(initialPatterns, Store, A.Dummy <ISemanticLog>(), appPlansProvider, appPlansBillingManager, userResolver);
            sut.ActivateAsync(Id).Wait();
        }
Beispiel #2
0
        public AppGrainTests()
        {
            A.CallTo(() => user.Id)
            .Returns(contributorId);

            A.CallTo(() => userResolver.FindByIdOrEmailAsync(contributorId))
            .Returns(user);

            initialPatterns = new InitialPatterns
            {
                { patternId1, new AppPattern("Number", "[0-9]") },
                { patternId2, new AppPattern("Numbers", "[0-9]*") }
            };

            sut = new AppGrain(initialPatterns, Store, A.Dummy <ISemanticLog>(), appPlansProvider, appPlansBillingManager, userResolver);
            sut.ActivateAsync(Id).Wait();
        }