Пример #1
0
 public UnifiedModuleMessageViewServiceTests()
 {
     mapper  = CreateService <Mapper>();
     service = CreateService <UnifiedModuleMessageViewService>();
     //commentService =
     unit            = CreateUnitAsync().Result;
     commonRequester = new Requester()
     {
         userId = unit.commonUser.id
     };
     specialRequester = new Requester()
     {
         userId = unit.specialUser.id
     };
 }
Пример #2
0
        public async Task <ReadTestUnit> CreateUnitAsync()
        {
            //First, create some users!
            var unit      = new ReadTestUnit();
            var requester = new Requester()
            {
                system = true
            };

            unit.commonUser = await userService.WriteAsync(new UserViewFull()
            {
                username = "******"
            }, requester);

            unit.specialUser = await userService.WriteAsync(new UserViewFull()
            {
                username = "******"
            }, requester);

            unit.commonContent = await contentService.WriteAsync(new ContentView()
            {
                name = "commonContent", parentId = 0, permissions = new Dictionary <long, string>()
                {
                    { 0, "cr" }
                }
            }, requester);

            unit.specialContent = await contentService.WriteAsync(new ContentView()
            {
                name = "specialContent", parentId = 0, permissions = new Dictionary <long, string>()
                {
                    { unit.specialUser.id, "cr" }
                }
            }, requester);

            return(unit);
        }
Пример #3
0
 public ReadTestStatic() : base()
 {
     unit = CreateUnitAsync().Result;
 }
Пример #4
0
 public ReadTestBaseExtra() : base()
 {
     unit         = CreateUnitAsync().Result;
     cancelSource = new CancellationTokenSource();
     cancelToken  = cancelSource.Token;
 }
Пример #5
0
 public ActivityViewSourceTests()
 {
     service  = CreateService <ActivityViewSource>();
     provider = CreateService <IEntityProvider>();
     unit     = CreateUnitAsync().Result;
 }