Beispiel #1
0
 public static Common.DataModel.Organization MakeTestOrg(Common.DataModel.ShipHubContext context, long orgId = 6001, string login = "******")
 {
     context.BulkUpdateAccounts(DateTimeOffset.UtcNow, new[] {
         new AccountTableType()
         {
             Id    = orgId,
             Login = login,
             Type  = "org",
         },
     }).GetAwaiter().GetResult();
     return(context.Organizations.Single(x => x.Id == orgId));
 }
Beispiel #2
0
        public static Common.DataModel.User MakeTestUser(Common.DataModel.ShipHubContext context, long userId = 3001, string login = "******")
        {
            context.BulkUpdateAccounts(DateTimeOffset.UtcNow, new[] {
                new AccountTableType()
                {
                    Id    = userId,
                    Login = login,
                    Type  = "user",
                },
            }).GetAwaiter().GetResult();
            context.SetUserAccessToken(
                userId,
                "scope,OtherScope",
                new Common.GitHub.GitHubRateLimit(Guid.NewGuid().ToString(), 5000, 5000, DateTimeOffset.UtcNow.AddHours(1)))
            .GetAwaiter().GetResult();
            var user = context.Users.Single(x => x.Id == userId);

            return(user);
        }