Exemplo n.º 1
0
 public Echipe(TextNume nume, List <Taberist> taberisti)
 {
     Contract.Requires(nume != null, "nume =>null");
     this.nume      = nume;
     this.punctaj   = new List <Puncte>();
     this.taberisti = taberisti;
 }
Exemplo n.º 2
0
        public Activitate CreeazaActivitate(TextNume nume, int durata, Puncte punctajCastigator)
        {
            Contract.Requires <ArgumentNullException>(nume != null, "text");
            var activitate = new Activitate(nume, durata, punctajCastigator);

            return(activitate);
        }
Exemplo n.º 3
0
 public Organizator(TextNume nume, int varsta, GradOrganizator grad)
 {
     this.nume     = nume;
     this.varsta   = varsta;
     this.feedBack = new List <string>();
     this.Grad     = grad;
 }
Exemplo n.º 4
0
 public Activitate(TextNume nume, int durata, Puncte punctajCastigator)
 {
     stareActivitate        = StareActivitate.Creeata;
     this.durata            = durata;
     this.echipe            = new List <Echipe>();
     this.punctajCastigator = punctajCastigator;
 }
Exemplo n.º 5
0
        public Organizator CreeazaOrganizator(TextNume nume, int varsta, GradOrganizator grad)
        {
            Contract.Requires <ArgumentNullException>(nume != null);
            Contract.Requires <ArgumentNumbersException>(System.Text.RegularExpressions.Regex.IsMatch(nume.ToString(), @"\d"), "Numele nu trebuie sa contina numere");

            var organizator = new Organizator(nume, varsta, grad);

            return(organizator);
        }
Exemplo n.º 6
0
        public void echipaCastigatoare()  // folosire Mock's
        {
            //arrange
            TextNume echipa = new TextNume("Alpha");

            _externalMock
            .Setup(m => m.calculPunctajMaxEchipa())
            .Returns(echipa);

            var classTested = activitate;

            //act
            TextNume echipaWinning = classTested.getEchipaCastigatoare();

            //assert
            Assert.Equal("Alpha", echipaWinning.Text);
        }
Exemplo n.º 7
0
        public TextNume calculPunctajMaxEchipa()
        {
            int      max  = 0;
            TextNume nume = new TextNume("");

            foreach (Echipe e in echipe)
            {
                int S = 0;
                foreach (Puncte p in e.Punctaj)
                {
                    S = S + p.Valoare;
                }
                if (S > max)
                {
                    max  = S;
                    nume = new TextNume(e.nume.Text);
                }
            }
            return(nume);
        }