public override void Given()
        {
            this.AuthenticationHelper = new Mock<IAuthenticationHelper>();
            this.AuthenticationHelper.SetupGet(x => x.NameIdentifier).Returns(TestValues.NAME_IDENTIFIER);

            this.TableStorageContext = new Mock<ITableStorageContext> { DefaultValue = DefaultValue.Mock };

            var tableStorageContextFactory = new TableStorageContextFactoryMockBuilder()
                .SetTableStorageContext(this.TableStorageContext)
                .Build();

            this.UserConfiguration = new UserConfiguration
            {
                QuizInterval0 = 1,
                QuizInterval1 = 6,
                QuizInterval2 = 24,
                QuizInterval3 = 66,
                QuizInterval4 = 114,
                QuizInterval5 = 246
            };

            this.TableStorageContext
                .Setup(x => x.UserConfigurations.GetByNameIdentifier())
                .Returns(this.UserConfiguration);

            this.QuizResultHandler = new QuizResultHandler(tableStorageContextFactory.Object, this.AuthenticationHelper.Object);
        }
        public override void Given()
        {
            // Set the refresh interval to 0 so that the test thread doesn't sleep
            ConfigurationSettings.SeedRefreshIntervalSeconds = 0;
            this.IdentityCloudQueue = new Mock<IIdentityCloudQueue> { DefaultValue = DefaultValue.Mock };
            this.TableStorageContext = new Mock<ITableStorageContext>{ DefaultValue = DefaultValue.Mock };
            this.MasterConfiguration = new MasterConfiguration{CurrentMaxIdentity = CURRENT_MAX_IDENTITY};
            this.TableStorageContext.Setup(x => x.MasterConfigurations.GetOrCreate(Keys.MASTER, Keys.CONFIGURATION)).Returns(this.MasterConfiguration);

            var tableStorageContextFactory = new TableStorageContextFactoryMockBuilder()
                .SetTableStorageContext(this.TableStorageContext, AzureTableNames.CONFIGURATION, NameIdentifiers.MASTER)
                .Build();

            this.IdentityQueueSeeder = new IdentityQueueSeeder(tableStorageContextFactory.Object, this.IdentityCloudQueue.Object);
        }
        public override void Given()
        {
            this.TableStorageContext = new Mock<ITableStorageContext> { DefaultValue = DefaultValue.Mock };

            var tableStorageContextFactory = new TableStorageContextFactoryMockBuilder()
                .SetTableStorageContext(this.TableStorageContext, AzureTableNames.CARD, NameIdentifiers.MASTER)
                .Build();

            var userConfiguration = new UserConfiguration
            {
                PartitionKey = TestValues.PARTITION_KEY,
                RowKey = string.Format("{0}-{1}", CardRowTypes.CONFIGURATION, TestValues.USER_ID)
            };

            this.TableStorageContext.Setup(x => x.UserConfigurations.GetByUserId(TestValues.USER_ID)).Returns(userConfiguration);
            this.LibraryController = new CardsController(tableStorageContextFactory.Object);
        }
        public override void Given()
        {
            this.TableStorageContext = new Mock<ITableStorageContext> { DefaultValue = DefaultValue.Mock };

            var tableStorageContextFactory = new TableStorageContextFactoryMockBuilder()
                .SetTableStorageContext(this.TableStorageContext)
                .Build();

            var authenticationHelper = new Mock<IAuthenticationHelper>();
            authenticationHelper.Setup(x => x.NameIdentifier).Returns(TestValues.NAME_IDENTIFIER);

            var cardsBatchController = new CardsBatchController(tableStorageContextFactory.Object, authenticationHelper.Object);
            var apiControllerBuilder = new ApiControllerBuilder<CardsBatchController>(cardsBatchController);

            this.CardsBatchController = apiControllerBuilder
                .CreateRequest(HttpMethod.Put, TestUrls.CARDS)
                .Build();
        }
        public override void Given()
        {
            this.TableStorageContext = new Mock<ITableStorageContext> { DefaultValue = DefaultValue.Mock };

            var tableStorageContextFactory = new TableStorageContextFactoryMockBuilder()
                .SetTableStorageContext(this.TableStorageContext)
                .Build();

            this.AuthenticationHelper = new Mock<IAuthenticationHelper> { DefaultValue = DefaultValue.Mock };

            this.AuthenticationHelper
                .SetupGet(x => x.NameIdentifier)
                .Returns(TestValues.NAME_IDENTIFIER);

            this.ConfigController = new ConfigController(tableStorageContextFactory.Object, this.AuthenticationHelper.Object);
            this.ConfigController = new ApiControllerBuilder<ConfigController>(this.ConfigController)
                .CreateRequest(HttpMethod.Put, TestUrls.CONFIG)
                .Build();
        }
        public override void Given()
        {
            this.TableStorageContext = new Mock<ITableStorageContext> { DefaultValue = DefaultValue.Mock };

            var tableStorageContextFactory = new TableStorageContextFactoryMockBuilder()
                .SetTableStorageContext(this.TableStorageContext)
                .Build();

            this.QuizResultHandler = new Mock<IQuizResultHandler>();
            var authenticationHelper = new Mock<IAuthenticationHelper>();
            authenticationHelper.Setup(x => x.NameIdentifier).Returns(TestValues.NAME_IDENTIFIER);
            this.Request = new HttpRequestMessage(HttpMethod.Post, TestUrls.QUIZ_RESULTS);

            var quizResultsController = new QuizResultsControllerFake(
                tableStorageContextFactory.Object,
                this.QuizResultHandler.Object,
                authenticationHelper.Object);

            this.QuizResultsController = new ApiControllerBuilder<QuizResultsControllerFake>(quizResultsController)
               .CreateRequest(this.Request)
               .Build();
        }