Example #1
0
        public async Task JoinTest()
        {
            var c = ContainerHelper.Builder();

            var hub       = c.Resolve <IUserHub>();
            var platUsr   = c.Resolve <IPlatformUserService>();
            var courseSvc = c.Resolve <ICourseServices>();
            var appUsr    = c.Resolve <IAppUser>();
            var mapper    = c.Resolve <IMapper>();

            var ctrl = new PlatforUserController(platUsr, hub, courseSvc, appUsr, mapper);

            string cid = await new CourseTest().Create();

            var rev = await ctrl.Join(new Domain.DTOS.UserJoinDTO
            {
                CourseId = cid //"9093749692826648576"
            });

            Assert.IsTrue(rev.Data());

            rev = await ctrl.Leavel(new Domain.DTOS.IdDto(cid));

            Assert.IsTrue(rev.Data());
        }
Example #2
0
        public CollabratorController cbtCtrl()
        {
            var c = ContainerHelper.Builder();

            return(new CollabratorController(
                       c.Resolve <IAppUser>(),
                       c.Resolve <IMapper>(),
                       c.Resolve <ICourseServices>(),
                       c.Resolve <ICollabratorQuery>()));
        }
Example #3
0
        private static CourseController Ctrl(string role = "teacher")
        {
            var c         = ContainerHelper.Builder(role);
            var svc       = c.Resolve <ICourseServices>();
            var usr       = c.Resolve <IAppUser>();
            var platUsr   = c.Resolve <IPlatformUserService>();
            var mapper    = c.Resolve <IMapper>();
            var partnerSv = c.Resolve <IPartnerService>();

            var ctrl = new CourseController(svc, platUsr, mapper, usr, partnerSv
                                            , c.Resolve <IPermission>()
                                            , c.Resolve <IIDTools>());

            return(ctrl);
        }
Example #4
0
        public async Task GetSetTest()
        {
            var c = ContainerHelper.Builder();

            ICachingProvider _cp = c.Resolve <ICachingProvider>();

            var val = await _cp.Get("a", async() =>
            {
                await Task.CompletedTask;

                return("aab");
            });


            Assert.AreEqual(val, "aab");
        }