Esempio n. 1
0
        public void Setup()
        {
            this.context = HubContextImplementation.GetContext;

            this.cardRepository             = new CardRepository();
            this.deckRepository             = new DeckRepository();
            this.discussionResultRepository = new DiscussionResultRepository();
            this.roomRepository             = new RoomRepository();
            this.userRepository             = new UserRepository();

            this.userService             = new UserService(this.userRepository, this.context);
            this.cardService             = new CardService(this.cardRepository, this.context, this.userService);
            this.deckService             = new DeckService(this.deckRepository, this.cardRepository, this.context, this.userService);
            this.discussionResultService = new DiscussionResultService(this.discussionResultRepository, this.cardRepository, this.userRepository);
            this.roomService             = new RoomService(this.roomRepository, this.userRepository, this.deckRepository, this.context, this.userService, this.discussionResultService);

            this.userService.AddUserToConnectionMap("TestUser", "TestConnection");

            this.cards             = new Cards();
            this.decks             = new Decks();
            this.discussionResults = new DiscussionResults();
            this.rooms             = new Rooms();
            this.users             = new Users();

            InvokedSignalRMethod = string.Empty;
        }
        /// <summary>
        /// Конструктор репозитория с заполнением тестовым данными.
        /// </summary>
        public DiscussionResultRepository()
        {
            DiscussionResults results = new DiscussionResults();

            this.Save(results.TestDiscussionResult1);
            this.Save(results.TestDiscussionResult2);
        }