Example #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 );
        }
Example #2
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 ) );
        }