Ejemplo n.º 1
0
        public async Task Setup()
        {
            context = await TestDatabase.GetDatabaseContext();

            mockDifficultiesService = new MockDifficultiesService(context);
            mockAppsService         = new MockAppsService(context);

            baseRequest = new BaseRequest();

            updateDifficultyRequest = new UpdateDifficultyRequest()
            {
                Id          = 1,
                Name        = "Test Difficulty",
                License     = TestObjects.GetLicense(),
                RequestorId = 1,
                Paginator   = new Paginator()
            };

            createDifficultyRequest = new CreateDifficultyRequest()
            {
                Name            = "Test Difficulty",
                DifficultyLevel = DifficultyLevel.TEST,
                License         = TestObjects.GetLicense(),
                RequestorId     = 1,
                Paginator       = new Paginator()
            };

            sutSuccess = new DifficultiesController(
                mockDifficultiesService.DifficultiesServiceSuccessfulRequest.Object,
                mockAppsService.AppsServiceSuccessfulRequest.Object);

            sutFailure = new DifficultiesController(
                mockDifficultiesService.DifficultiesServiceFailedRequest.Object,
                mockAppsService.AppsServiceSuccessfulRequest.Object);
        }
Ejemplo n.º 2
0
        public async Task Setup()
        {
            context = await TestDatabase.GetDatabaseContext();

            mockGamesService = new MockGamesService(context);
            mockAppsService  = new MockAppsService(context);

            baseRequest = new BaseRequest();

            createGameRequest = new CreateGameRequest();

            getMyGameRequest = new GamesRequest()
            {
                UserId      = 1,
                License     = TestObjects.GetLicense(),
                RequestorId = 1,
                Paginator   = new Paginator()
            };

            updateGameRequest = TestObjects.GetUpdateGameRequest();

            sutSuccess = new GamesController(
                mockGamesService.GamesServiceSuccessfulRequest.Object,
                mockAppsService.AppsServiceSuccessfulRequest.Object);

            sutFailure = new GamesController(
                mockGamesService.GamesServiceFailedRequest.Object,
                mockAppsService.AppsServiceSuccessfulRequest.Object);
        }
Ejemplo n.º 3
0
        public async Task Setup()
        {
            context = await TestDatabase.GetDatabaseContext();

            mockUsersService = new MockUsersService(context);
            mockAppsService  = new MockAppsService(context);

            sut = new PasswordResetController(
                mockUsersService.UsersServiceSuccessfulRequest.Object,
                mockAppsService.AppsServiceSuccessfulRequest.Object);

            passwordResetToken = Guid.NewGuid().ToString();
        }
Ejemplo n.º 4
0
        public async Task Setup()
        {
            context = await TestDatabase.GetDatabaseContext();

            mockUsersService       = new MockUsersService(context);
            mockAppsService        = new MockAppsService(context);
            mockWebHostEnvironment = new Mock <IWebHostEnvironment>();

            baseRequest = new BaseRequest();

            updateUserRequest = new UpdateUserRequest()
            {
                UserName    = "******",
                FirstName   = "FirstName",
                LastName    = "LastName",
                NickName    = "MyNickname",
                Email       = "*****@*****.**",
                License     = TestObjects.GetLicense(),
                RequestorId = 1,
                Paginator   = new Paginator()
            };

            updatePasswordRequest = new UpdatePasswordRequest()
            {
                UserId      = 1,
                NewPassword = "******"
            };

            updateUserRoleRequest = new UpdateUserRoleRequest()
            {
                RoleIds = new List <int>()
                {
                    3
                },
                License     = TestObjects.GetLicense(),
                RequestorId = 1,
                Paginator   = new Paginator()
            };

            sutSuccess = new UsersController(
                mockUsersService.UsersServiceSuccessfulRequest.Object,
                mockAppsService.AppsServiceSuccessfulRequest.Object,
                mockWebHostEnvironment.Object);

            sutFailure = new UsersController(
                mockUsersService.UsersServiceFailedRequest.Object,
                mockAppsService.AppsServiceSuccessfulRequest.Object,
                mockWebHostEnvironment.Object);
        }
        public async Task Setup()
        {
            context = await TestDatabase.GetDatabaseContext();

            mockAppsService = new MockAppsService(context);

            baseRequest = new BaseRequest();

            appRequest = TestObjects.GetAppRequest();

            sutSuccess            = new AppsController(mockAppsService.AppsServiceSuccessfulRequest.Object);
            sutFailure            = new AppsController(mockAppsService.AppsServiceFailedRequest.Object);
            sutInvalid            = new AppsController(mockAppsService.AppsServiceInvalidRequest.Object);
            sutPromoteUserFailure = new AppsController(mockAppsService.AppsServicePromoteUserFailsRequest.Object);
        }
Ejemplo n.º 6
0
        public async Task Setup()
        {
            context = await TestDatabase.GetDatabaseContext();

            mockAppsService = new MockAppsService(context);

            baseRequest = new BaseRequest();

            appRequest = new AppRequest()
            {
                Name        = "New Test App 3",
                DevUrl      = "https://localhost:8080",
                LiveUrl     = "https://TestApp3.com",
                License     = TestObjects.GetLicense(),
                RequestorId = 1,
                Paginator   = new Paginator()
            };

            sutSuccess = new LicensesController(mockAppsService.AppsServiceSuccessfulRequest.Object);
            sutFailure = new LicensesController(mockAppsService.AppsServiceFailedRequest.Object);
        }
Ejemplo n.º 7
0
        public async Task Setup()
        {
            context = await TestDatabase.GetDatabaseContext();

            mockSolutionsService = new MockSolutionsService(context);
            mockAppsService      = new MockAppsService(context);

            baseRequest = new BaseRequest();

            solutionRequest = new SolutionRequest()
            {
                FirstRow = new List <int> {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                },
                SecondRow = new List <int> {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                },
                ThirdRow = new List <int> {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                },
                FourthRow = new List <int> {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                },
                FifthRow = new List <int> {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                },
                SixthRow = new List <int> {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                },
                SeventhRow = new List <int> {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                },
                EighthRow = new List <int> {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                },
                NinthRow = new List <int> {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                }
            };

            addSolutionRequest = new AddSolutionRequest()
            {
                Limit = 1000
            };

            invalidAddSolutionRequest = new AddSolutionRequest()
            {
                Limit = 1001
            };

            sutSuccess = new SolutionsController(
                mockSolutionsService.SolutionsServiceSuccessfulRequest.Object,
                mockAppsService.AppsServiceSuccessfulRequest.Object);

            sutFailure = new SolutionsController(
                mockSolutionsService.SolutionsServiceFailedRequest.Object,
                mockAppsService.AppsServiceSuccessfulRequest.Object);

            sutSolvedFailure = new SolutionsController(
                mockSolutionsService.SolutionsServiceSolveFailedRequest.Object,
                mockAppsService.AppsServiceSuccessfulRequest.Object);
        }