コード例 #1
0
ファイル: SommeTupleTests.cs プロジェクト: MrTete/Bowling
        public void TestGetSomme1()
        {
            JeuScore jeuScore = new JeuScore(10);

            jeuScore.Add(new Tuple <int, int>(2, 3));
            jeuScore.Add(new Tuple <int, int>(5, 5));
            jeuScore.Add(new Tuple <int, int>(1, 0));
            jeuScore.Add(new Tuple <int, int>(1, 0));
            jeuScore.Add(new Tuple <int, int>(1, 0));
            jeuScore.Add(new Tuple <int, int>(1, 0));
            jeuScore.Add(new Tuple <int, int>(1, 0));
            jeuScore.Add(new Tuple <int, int>(1, 0));
            jeuScore.Add(new Tuple <int, int>(1, 0));
            jeuScore.Add(new Tuple <int, int>(1, 0));
            Assert.AreEqual(24, jeuScore.GetSomme());//5+11+8
        }
コード例 #2
0
ファイル: SommeTupleTests.cs プロジェクト: MrTete/Bowling
        public void TestGetSomme3()
        {
            JeuScore jeuScore = new JeuScore(10);

            jeuScore.Add(new Tuple <int, int>(2, 3));
            jeuScore.Add(new Tuple <int, int>(10, 0));
            jeuScore.Add(new Tuple <int, int>(10, 0));
            jeuScore.Add(new Tuple <int, int>(5, 5));
            jeuScore.Add(new Tuple <int, int>(7, 2));
            jeuScore.Add(new Tuple <int, int>(2, 3));
            jeuScore.Add(new Tuple <int, int>(10, 0));
            jeuScore.Add(new Tuple <int, int>(10, 0));
            jeuScore.Add(new Tuple <int, int>(4, 5));
            jeuScore.Add(new Tuple <int, int>(7, 2));
            Assert.AreEqual(5 + 25 + 20 + 17 + 9 + 5 + 24 + 19 + 9 + 9, jeuScore.GetSomme()); //5+25+20+17+9+5+24+19+9+9
        }
コード例 #3
0
ファイル: SommeTupleTests.cs プロジェクト: MrTete/Bowling
        public void Test300points()
        {
            JeuScore jeuScore = new JeuScore(10);

            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));
            Assert.IsTrue(jeuScore.Add(new Tuple <int, int>(10, 0)));

            Assert.AreEqual(300, jeuScore.GetSomme());
        }
コード例 #4
0
ファイル: SommeTupleTests.cs プロジェクト: MrTete/Bowling
        public void TestEntreeNull()
        {
            List <Tuple <int, int> > array = null;
            JeuScore s    = new JeuScore(array, 10);
            bool     isOk = false;

            try
            {
                s.GetSomme();
            }
            catch (ArgumentNullException e)
            {
                isOk = true;
            }
            if (!isOk)
            {
                Assert.Fail();
            }
        }