<commit_before>import { TestBed } from '@angular/core/testing';
import { OAuthModule, OAuthLogger, OAuthService, UrlHelperService } from 'angular-oauth2-oidc';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { Socket } from '../services/socketio.service';

import { User } from '../services/user.service';

describe('User', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      declarations: [
        User,
      ],
      imports: [
        OAuthModule.forRoot(),
        HttpClientTestingModule,
        RouterTestingModule,
      ],
      providers: [
        Socket, OAuthService,
        OAuthLogger,
        UrlHelperService
      ],
    }).compileComponents();
  });
  
  it('should create the service', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app).toBeTruthy();
  });
  
  it('test setConfig', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    let object = {};
    app.setConfig(object)
    expect(app.config).toEqual(object);
  });
  
  it('test setUser', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    let object = {};
    app.setUser(object)
    expect(app.info).toEqual(object);
  });
  
  it('test setUserRess', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    let object = {'drachma': 1};
    app.setUserRess(object)
    expect(app.info.drachma).toEqual(object.drachma);
  });
  
  
});
<commit_msg>Add new tests to the user service<commit_after>import { TestBed } from '@angular/core/testing';
import { OAuthModule, OAuthLogger, OAuthService, UrlHelperService } from 'angular-oauth2-oidc';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { Socket } from './socketio.service';

import { User } from './user.service';

describe('User', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      declarations: [
        User,
      ],
      imports: [
        OAuthModule.forRoot(),
        HttpClientTestingModule,
        RouterTestingModule,
      ],
      providers: [
        Socket, OAuthService,
        OAuthLogger,
        UrlHelperService
      ],
    }).compileComponents();
  });
  
  it('should create the service', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app).toBeTruthy();
  });
  
  it('test setConfig', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    let object = {};
    app.setConfig(object)
    expect(app.config).toEqual(object);
  });
  
  it('test setUser', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    let object = {};
    app.setUser(object)
    expect(app.info).toEqual(object);
  });
  
  it('test setUserRess', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    let object = {'drachma': 1};
    app.setUserRess(object)
    expect(app.info.drachma).toEqual(object.drachma);
  });
  
  it('test buildTemple1Allowed', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.buildTemple1Allowed()).toEqual(0);
  });
  it('test buildTemple2Allowed', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.buildTemple2Allowed()).toEqual(1);
    
    app.setUser({'level': 6})
    expect(app.buildTemple2Allowed()).toEqual(0);
  });
  it('test buildTemple3Allowed', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.buildTemple3Allowed()).toEqual(1);
    
    app.setUser({'level': 8})
    expect(app.buildTemple3Allowed()).toEqual(0);
  });
  it('test buildTemple4Allowed', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.buildTemple4Allowed()).toEqual(1);
    
    app.setUser({'level': 10})
    expect(app.buildTemple4Allowed()).toEqual(0);
    
    app.setUser({'level': 10, 'zeus': 1})
    expect(app.buildTemple4Allowed()).toEqual(1);
  });
  
  it('test getArmy', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getArmy()).toEqual([]);
  });
  
  it('test getBuildings', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getBuildings()).toEqual([]);
  });
  
  it('test getDatas', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getDatas()).toEqual({'ress_lvl': 0});
  });
  
  it('test getId', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getId()).toEqual(0);
  });
  
  it('test getLevel', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getLevel()).toEqual(0);
  });
  
  it('test getProperty', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getProperty('style')).toEqual('default');
  });
  
  it('test getPropertyNb', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getPropertyNb('id')).toEqual(0);
  });
  
  it('test getConfig', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getConfig()).toEqual({'weather': 'sun'});
  });
  
  it('test getInit', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getInit()).toEqual(0);
  });
  
  it('test getQuest', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    app.setUser({'quest': 2})
    expect(app.getQuest()).toEqual(2);
  });
  
  it('test getQuestValidate', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    app.setUser({'quest_validate': 1})
    expect(app.getQuestValidate()).toEqual(1);
  });
  
  it('test getQuestMax', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    app.setUser({'level': 0})
    expect(app.getQuestMax()).toEqual(14);
    
    app.setUser({'level': 1})
    expect(app.getQuestMax()).toEqual(14);
    
    app.setUser({'level': 2})
    expect(app.getQuestMax()).toEqual(12);
    
    app.setUser({'level': 3})
    expect(app.getQuestMax()).toEqual(9);
    
    app.setUser({'level': 4})
    expect(app.getQuestMax()).toEqual(10);
    
    app.setUser({'level': 5})
    expect(app.getQuestMax()).toEqual(7);
    
    app.setUser({'level': 6})
    expect(app.getQuestMax()).toEqual(8);
    
    app.setUser({'level': 7})
    expect(app.getQuestMax()).toEqual(7);
    
    app.setUser({'level': 8})
    expect(app.getQuestMax()).toEqual(10);
    
    app.setUser({'level': 9})
    expect(app.getQuestMax()).toEqual(18);
    
    app.setUser({'level': 10})
    expect(app.getQuestMax()).toEqual(0);
  });
  
  it('test getLevelRess', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    
    expect(app.getLevelRess('drachma')).toEqual(0);
  });
  
  it('test getSanctuary', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getSanctuary('random')).toEqual(0);
  });
  
  it('test getTaxes', () => {
    const fixture = TestBed.createComponent(User);
    fixture.detectChanges();
    const app = fixture.componentInstance;
    expect(app.getTaxes('drachma')).toEqual(0);
  });
  
  
});

{'fraction_non_alphanumeric': 0.16196388261851016, 'fraction_numerical': 0.008126410835214447, 'mean_word_length': 3.4843117408906883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3377971', 'n_tokens_mistral': 2762, 'n_tokens_neox': 2775, 'n_words': 440}