public async Task AddScopeTestAsync() { const long newId = 1L; const string newScope = "scope.new"; await using (var context = NewContext()) { var service = new ScopeService(context); await service.AddScopeAsync(new Scope { UserId = newId, ScopeId = newScope }); await context.CommitAsync(); } await using (var context = NewContext()) { var service = new ScopeService(context); var result = await service.HasScopeAsync(newId, new [] { newScope }); Assert.True(result); } }