Exemplo n.º 1
0
        protected async override Task OnInitializedAsync()
        {
            HomeViewModel.Projects = await ProjectService.GetAllProjects();

            HomeViewModel.Communities = await CommunityService.GetCommunities();

            HomeViewModel.Courses = await CourseService.GetCourses();
        }
Exemplo n.º 2
0
        public void Should_return_5_communities_when_get_all_Communities()
        {
            var response = _fixture.Build <CommunityResponseModel>()
                           .With(x => x.Results, _fixture.Build <CommunityModel>()
                                 .CreateMany(5).ToList())
                           .Create();

            var criteria      = new CommunityCriteriaModel();
            var communityRepo = Substitute.For <ICommunityRepository>();

            communityRepo.GetCommunities(criteria).Returns(response);
            var communityService = new CommunityService(communityRepo);
            var responseModel    = communityService.GetCommunities(criteria).Result;

            responseModel.Results.FirstOrDefault().Should().BeOfType <CommunityModel>();
            responseModel.Results.Count().Should().Be(5);
        }
Exemplo n.º 3
0
 protected override async Task OnInitializedAsync()
 {
     Communties = await CommunityService.GetCommunities();
 }
 public JsonResult CommunityList()
 {
     return(Json(service.GetCommunities(), JsonRequestBehavior.AllowGet));
 }