Exemplo n.º 1
0
        //Création des actions et ajout dans le dictionary
        public Action(user u)
        {
            this.u = u;
            ActionsInfo Ford = new ActionsInfo( this, "Ford", 1.0, 1.08, 0, "Voiture", 0, true, true, "Black" );
            ActionsInfo Total = new ActionsInfo( this, "Total", 1.0, 1.05, 0, "Pétrole", 0, true, true, "Blue" );
            ActionsInfo Ubisoft = new ActionsInfo( this, "Ubisoft", 1.2, 0.99, 0, "Informatique", 0, true, true, "Cyan" );
            ActionsInfo Nokia = new ActionsInfo( this, "Nokia", 1.0, 0.98, 0, "Electronique", 0, true, true, "Green" );
            ActionsInfo Acer = new ActionsInfo( this, "Acer", 1.0, 0.99, 0, "Voiture", 0, true, true, "Magenta" );
            ActionsInfo Aesus = new ActionsInfo( this, "Aesus", 1.0, 0.99, 0, "Electronique", 0, true, true, "Red" );
            ActionsInfo Chanel = new ActionsInfo( this, "Chanel", 1.0, 1.01, 0, "Vêtements", 0, true, true, "DarkMagenta" );
            ActionsInfo BOSS = new ActionsInfo( this, "BOSS", 1.0, 1.01, 0, "Vêtements", 0, true, true, "Gray" );
            ActionsInfo Foncia = new ActionsInfo( this, "Foncia", 1.0, 1.15, 0, "Immobilier", 0, true, true,"DarkRed" );
            ActionsInfo Seloger = new ActionsInfo( this, "Seloger", 1.2, 0.99, 0, "Immobilier", 0, true, true, "DarkBlue" );
            ActionsInfo Nissan = new ActionsInfo( this, "Nissan", 1.0, 1.1, 0, "Voiture", 0, true, true, "DarkGray" );

            A.Add( "Ford", Ford );
            A.Add( "Total", Total );
            A.Add( "Ubisoft", Ubisoft );
            A.Add( "Nokia", Nokia );
            A.Add( "Acer", Acer );
            A.Add( "Aesus", Aesus );
            A.Add( "Chanel", Chanel );
            A.Add( "BOSS", BOSS );
            A.Add( "Foncia", Foncia );
            A.Add( "Seloger", Seloger );
            A.Add( "Nissan", Nissan );
        }
Exemplo n.º 2
0
 public PopUpAdvise(Form1 f, user u)
 {
     this.f = f;
     this.u = u;
     InitializeComponent();
     showAdvises();
 }
Exemplo n.º 3
0
 public PopUpEmployer(Form1 f, user u )
 {
     this.u = u;
     this.f = f;
     InitializeComponent();
     showEmployer();
 }
Exemplo n.º 4
0
 public PopUpBonuscs(Form1 f, user u)
 {
     this.f = f;
     this.u = u;
     InitializeComponent();
     showBonus();
 }
Exemplo n.º 5
0
        // Création des news et ajout dans le dictionary
        public News(user u)
        {
            this.u = u;

            NewsInfo criseAuCaire = new NewsInfo(this, "Une crise éclate au caire.", "Manifestations contre le gouvernement en place en Irak, le pays est paralisé", "désactivé",10,30,10,1, "Pétrole", 0.95,"Geopoliticien", "WW3");
            NewsInfo Gisement = new NewsInfo(this, "Découverte d'une gisement", "Découverte d'un immense gisement de pétrole au coeur de la Gironde", "désactivé",10,30,10,1,"Pétrole", 1.05, "Ingénieur", "none");
            NewsInfo CriseTextile = new NewsInfo( this, "Crise du textile", "L'industrie du textile en plus crise", "désactivé", 10, 30, 10, 1, "Vêtement", 0.95, "Geopoliticien", "none" );
            NewsInfo DéfiléMode = new NewsInfo(this, "Défilé de mode", "Incroyable succès du dernier défilé de mode parisien","désactivé",10,30,10,1,"Vêtement",1.05,"Coiffeuse","none");
            NewsInfo CriseTelephone = new NewsInfo( this, "Crise du téléphone", "15000 Iphone cassé chaque jour dans le monde , déja qu'ils ont pas de batterie...", "désactivé", 10, 30, 10, 1, "Mecano", 0.95, "Mecano", "none" );
            NewsInfo ExpansionConsole = new NewsInfo( this, "Expansion des jeux", "Le jeux vidéo fait un grand retour sur vos consoles cette année", "désactivé", 10, 30, 10, 1, "Electronique", 1.05, "Coiffeuse", "none" );
            NewsInfo CrashTest = new NewsInfo( this, "CrashTest", "D'après une récette enquète , les crash test des grandes compagnies de voitures seraient truqués","désactivé", 10, 30, 10, 1, "Voiture", 0.95, "Coiffeuse", "none" );
            NewsInfo AlcolVolant = new NewsInfo( this, "Alcol au volant", "Loi Bourbon , l'alcolémie au volant est maintenant autorisé", "désactivé", 10, 30, 10, 1, "Voiture", 0.95, "Coiffeuse", "none" );
            NewsInfo FonciaVoleur = new NewsInfo( this, "FOncia vole ", "Une association indépendante a porté plainte contre Foncia contre escroquerie","désactivé", 10, 30, 10, 1, "Commerial", 0.95, "Coiffeuse", "none" );
            NewsInfo BaisseDesprix = new NewsInfo( this, "Baisse des prix", "Baisse général du prix de l'immobilier dans toute la françe", "désactivé", 10, 30, 10, 1, "Immobilier", 1.05, "Commercial", "none" );
            NewsInfo Hack = new NewsInfo( this, "hack", "Hacking de tous les comptes tweeter", "désactivé", 10, 30, 10, 1, "Informatique", 0.95, "Mecano", "none" );
            NewsInfo LA5G = new NewsInfo (this , "5g", "La 5g est désormais disponible partout en françe","désactivé", 10,30,10,1,"Informatique", 1.05,"Mecano","none");

            N.Add( "criseAuCaire", criseAuCaire );
            N.Add("Gisement", Gisement);
            N.Add("CriseTextile",CriseTextile);
            N.Add( "DéfiléMode", DéfiléMode );
            N.Add( "CriseTelephone", CriseTelephone );
            N.Add( "ExpansionConsole", ExpansionConsole );
            N.Add( "CrashTest", CrashTest );
            N.Add("AlcolVolant",AlcolVolant);
            N.Add( "FonciaVoleur", FonciaVoleur );
            N.Add( "BaisseDesprix", BaisseDesprix );
            N.Add( "Hack", Hack );
            N.Add( "LA5G", LA5G );
        }
Exemplo n.º 6
0
 public Argent(user u)
 {
     this.u = u;
        money = 500;
        salary = 100;
        employer = "monPremierEmplois";
        notoriety = 1000;
 }
Exemplo n.º 7
0
 public void SellAction_Argent_Test(int price, double Gvalue, double value, int number, int expectedNewPrice, int expectedNewNot)
 {
     user u = new user();
     u.argent.SellAction( price, Gvalue, value, number );
     int result = u.argent.GetMoney();
     int resultNotoriety = u.argent.getNotoriety();
     Assert.That( result, Is.EqualTo( expectedNewPrice ) );
     Assert.That(resultNotoriety, Is.EqualTo(expectedNewNot));
 }
Exemplo n.º 8
0
        public void EmployerInfos_NewEMployer_Test()
        {
            user u = new user();
            Employer Employer = new Employer( u ); ;
            EmployerInfo E = new EmployerInfo( Employer, "clément", 1000, 2000, "inactif", true );
            E.NewEmployer();
            string result = E.state;

            Assert.That( result, Is.EqualTo( "actif" ) );
        }
Exemplo n.º 9
0
        public void EmployerInfos_GetEMployer_Test()
        {
            user u = new user();
            Employer Employer = new Employer( u ); ;
            EmployerInfo E = new EmployerInfo( Employer, "clément", 1000, 2000, "actif", true );

            Tuple<string , int , int , string> result = E.GetEmployer();

            Assert.That( result, Is.EqualTo( Tuple.Create( E.name, E.money, E.notoriety, E.state ) ) );
        }
Exemplo n.º 10
0
        public void CheckEmployer_Test( int notoriety, bool expectedResult )
        {
            user u = new user();
            Employer Employer = new Employer( u ); ;
            EmployerInfo E = new EmployerInfo( Employer, "clément", 1000, 2000, "actif", true );

            bool result = E.CheckEmployer( notoriety );

            Assert.That( result, Is.EqualTo(expectedResult) );
        }
Exemplo n.º 11
0
 public PopUpAction(Form1 f, user u, testProjet.Action a)
 {
     InitializeComponent();
     this.f = f;
     this.u = u;
     this.action = a;
     ShowMyActions();
     prix = 0.0;
     label2.Text = prix.ToString();
 }
Exemplo n.º 12
0
        public void UpdateNotorietyAfterNewEmployer_Argent_Test(int NewSalary, int NotToTake, int ExpectedSalary, int ExpectedNot)
        {
            user u = new user();
            u.argent.UpdateNotorietyAfterNewEmployer( NotToTake, NewSalary);
            int result = u.argent.getNotoriety();
            int result2 = u.argent.salary;

            Assert.That( result, Is.EqualTo( ExpectedNot ) );
            Assert.That(result2, Is.EqualTo(ExpectedSalary));
        }
Exemplo n.º 13
0
        public void Action_SellAction_Test()
        {
            user u = new user();
            testProjet.Action A = new testProjet.Action(u);
            ActionsInfo AI = new ActionsInfo( A, "Ford2", 1.0, 1.08, 0, "Voiture", 100, true, true, "Black" );
            A.A.Add( "Ford2", AI );
            A.SellAction( "Ford2", 100, 1.0 );
            int result = A.A["Ford2"].possess;

            Assert.That( result, Is.EqualTo( 0 ) );
            int result2 = u.argent.GetMoney();
            Assert.That( result2, Is.EqualTo( 600 ) );
        }
Exemplo n.º 14
0
        public Employer(user u)
        {
            this.u = u;
            EmployerInfo BNP = new EmployerInfo( this, "BNP", 500, 500, "inactif",false );
            EmployerInfo LCL = new EmployerInfo( this, "LCL", 1000, 2000, "inactif", false );
            EmployerInfo Edouard = new EmployerInfo( this, "Edouard", 2000, 5000, "inactif", false );
            EmployerInfo Clement = new EmployerInfo( this, "Clement", 5000, 10000, "inactif", false );

            D.Add( "BNP", BNP );
            D.Add( "LCL", LCL );
            D.Add( "Edouard", Edouard );
            D.Add( "Clement", Clement );

            employer = "MyFirstJob";
        }
Exemplo n.º 15
0
        public Form1()
        {
            user = new user();
            InitializeComponent();
            timer1.Tick += new EventHandler( timer1_Tick );
            timeTurn.Tick += new EventHandler( timer2_Tick );
            timeTurn.Interval = 25000;
            timeTurn.Start();
            timer1.Interval = 200;
            timer1.Start();

            typeof( Control ).GetProperty( "DoubleBuffered",
                             System.Reflection.BindingFlags.NonPublic |
                             System.Reflection.BindingFlags.Instance )
               .SetValue( objectListView1, true, null );

            UpdateAll();
        }
Exemplo n.º 16
0
        public void Constructor_EmployerInfos_Test()
        {
            user u = new user();
            Employer Employer = new Employer( u ); ;
            EmployerInfo E = new EmployerInfo( Employer, "clément", 1000, 2000, "actif", true );

            string result = E.name;
            var empl = E.E;
            int money = E.money;
            int not = E.notoriety;
            string state = E.state;
            bool res = E.achat;

            Assert.That( result, Is.EqualTo( "clément" ) );
            Assert.That( empl, Is.EqualTo( Employer ) );
            Assert.That( money, Is.EqualTo( 1000 ) );
            Assert.That( not, Is.EqualTo( 2000 ) );
            Assert.That( state, Is.EqualTo( "actif" ) );
            Assert.That( res, Is.True );
        }
Exemplo n.º 17
0
 private void button6_Click( object sender, EventArgs e )
 {
     string path = @"C:\Dev\S3\testProjet\Sauvegarde\Exemple1.bin";
     user newUser =  LoadFile( path );
     user = newUser;
     UpdateAll();
 }
Exemplo n.º 18
0
        public void Employer_ChangeEmployer_Test()
        {
            user u = new user();
            Employer Employer = u.employer;

            Employer.ChangeEmployer( "BNP" );

            string result = "BNP";

            Assert.That( result, Is.EqualTo(Employer.employer) );
        }