예제 #1
0
 public SmallBlogViewComponent(BlogService blogService,
                               SectionsService sectionsService, PostService postService)
 {
     this.blogService     = blogService;
     this.sectionsService = sectionsService;
     this.postService     = postService;
 }
        public QuestionnaireViewModel(SectionsService sectionsService)
        {
            _sectionsService = sectionsService;
            var sections = _sectionsService.GetSections();

            Sections = new BindableCollection <Section>(sections);
        }
예제 #3
0
 public MainScreenSectionsViewComponent(SectionsService sectionsService,
                                        BlogService blogService, UserInfoService userInfoService)
 {
     this.sectionsService = sectionsService;
     this.blogService     = blogService;
     this.userInfoService = userInfoService;
 }
예제 #4
0
 public SearchController(UserInfoService userInfoService,
                         BlogService blogService, SectionsService sectionsService,
                         SearchService searchService, UserBlogService userBlogService)
 {
     this.userInfoService = userInfoService;
     this.blogService     = blogService;
     this.sectionsService = sectionsService;
     this.searchService   = searchService;
     this.userBlogService = userBlogService;
 }
예제 #5
0
        public MainPageDataViewComponent(SearchService searchService, FriendsService friendsService,
                                         BlockService blockService, ReactionService reactionService,
                                         UserBlogService userBlogService, SectionsService sectionsService,
                                         BlogService blogService, UserInfoService userInfoService)
        {
            this.searchService   = searchService;
            this.friendsService  = friendsService;
            this.blockService    = blockService;
            this.reactionService = reactionService;
            this.userBlogService = userBlogService;
            this.sectionsService = sectionsService;
            this.blogService     = blogService;
            this.userInfoService = userInfoService;

            this.randomizer = new Random();
        }
예제 #6
0
        public async Task AllAsyncShouldReturnCorrectAnswerAndOrderedProperly()
        {
            //Arrange
            var dbOptions = new DbContextOptionsBuilder<UndergroundStationDbContext>()
                .UseInMemoryDatabase("UndergroundStationTestDb")
                .Options;

            var db = new UndergroundStationDbContext(dbOptions);

            var sectionsService = new SectionsService(db);

            var firtSection = new ForumSection
            {
                Id = 1,
                Tittle = "b"
            };

            var secondSection = new ForumSection
            {
                Id = 2,
                Tittle = "a"
            };

            db.AddRange(firtSection, secondSection);

            await db.SaveChangesAsync();

            //Act
            var result = await sectionsService
                .AllAsync();

            //Assert
            result
               .Should()
               .Match
               (r => r.ElementAt(0).Id == 2
               && r.ElementAt(1).Id == 1)
               .And
               .HaveCount(2);
        }
예제 #7
0
 public SectionController(SectionsService sectionsService)
 {
     this.sectionsService = sectionsService;
 }