예제 #1
0
        public void Setup()
        {
            var client          = new MongoClient(Constants.MongoDbConnectionUri());
            var movieRepository = new MoviesRepository(client);

            _movieController = new MovieController(movieRepository);
        }
        public void Setup()
        {
            var client = new MongoClient(Constants.MongoDbConnectionUri());

            _userRepository    = new UsersRepository(client);
            _commentRepository = new CommentsRepository(client);
            _movieRepository   = new MoviesRepository(client);
            _opinionatedUser   = new User
            {
                Name     = "Inigo Montoya",
                Email    = "*****@*****.**",
                Password = "******"
            };
            _anotherUser = new User
            {
                Name     = "Vizzini",
                Email    = "*****@*****.**",
                Password = "******"
            };
            _movieId = "573a1398f29313caabcea974";
            var jwt = new JwtAuthentication
            {
                SecurityKey   = "ouNtF8Xds1jE55/d+iVZ99u0f2U6lQ+AHdiPFwjVW3o=",
                ValidAudience = "https://localhost:5000/",
                ValidIssuer   = "https://localhost:5000/"
            };
            var appSettingsOptions = Options.Create(jwt);

            _userController    = new UserController(_userRepository, _commentRepository, appSettingsOptions);
            _commentController = new CommentController(_commentRepository, _userRepository, appSettingsOptions);
        }
예제 #3
0
        public void Setup()
        {
            var client = new MongoClient(Constants.MongoDbConnectionUri());

            _userRepository     = new UsersRepository(client);
            _sessionsCollection = client.GetDatabase("sample_mflix").GetCollection <Session>("sessions");
        }
예제 #4
0
        public void Setup()
        {
            var camelCaseConvention = new ConventionPack {
                new CamelCaseElementNameConvention()
            };

            ConventionRegistry.Register("CamelCase", camelCaseConvention, type => true);

            _client          = new MongoClient(Constants.MongoDbConnectionUri());
            _movieRepository = new MoviesRepository(_client);
        }
예제 #5
0
        public void Setup()
        {
            var client = new MongoClient(Constants.MongoDbConnectionUri());

            _userRepository     = new UsersRepository(client);
            _commentsRepository = new CommentsRepository(client);
            var jwt = new JwtAuthentication
            {
                SecurityKey   = "ouNtF8Xds1jE55/d+iVZ99u0f2U6lQ+AHdiPFwjVW3o=",
                ValidAudience = "https://localhost:5000/",
                ValidIssuer   = "https://localhost:5000/"
            };

            var appSettingsOptions = Options.Create(jwt);

            _userController = new UserController(_userRepository, _commentsRepository, appSettingsOptions);
        }
예제 #6
0
        public void Setup()
        {
            var client = new MongoClient(Constants.MongoDbConnectionUri());

            _commentsRepository = new CommentsRepository(client);
        }