public void TestPrintFirstS()
 {
     Entry Test = new Entry();
     Test.SetFirstShot(10);
     Assert.AreEqual(Test.PrintFirstShot(),"X");
     Test.SetFirstShot(5);
     Assert.AreEqual(Test.PrintFirstShot(), "5");
 }
示例#2
0
        //inicializa los valores del Board, usado para el primer board
        public void InitializeBoard()
        {
            Entries = new Entry[10];

            for (int i = 0; i < 10; i++)
            {
                Entries[i] = new Entry();
            }
        }
 public void TestPrintSecondS()
 {
     Entry Test = new Entry();
     Test.SetFirstShot(5);
     Assert.AreEqual(Test.PrintSecondShot()," ");
     Test.SetSecondShot(5);
     Assert.AreEqual(Test.PrintSecondShot(),"/");
     Test.SetFirstShot(4);
     Assert.AreEqual(Test.PrintSecondShot(),"5");
 }
        public void TestEntryPoints()
        {
            Entry Test = new Entry();

            Test.SetFirstShot(5);
            Test.SetSecondShot(7);
            Test.SetThirdShot(9);

            Assert.AreEqual(Test.EntryPoints(),21);
        }
        public void TestConstructor()
        {
            Entry Test = new Entry();

            Assert.AreEqual(Test.GetFirstShot(),-1,"FirstShot its OK");
            Assert.AreEqual(Test.GetSecondShot(), -1);
            Assert.AreEqual(Test.GetThirdShot(), -1);
            Assert.AreEqual(Test.GetToAdd(), 0);
            Assert.AreEqual(Test.GetAdded(), 0);
        }
        public void TestPrintThirdS()
        {
            Entry Test = new Entry();

            Assert.AreEqual(Test.PrintLastShot()," ");

            Test.SetThirdShot(10);
            Assert.AreEqual(Test.PrintLastShot(),"X");

            Test.SetThirdShot(6);
            Test.SetSecondShot(4);
            Assert.AreEqual(Test.PrintLastShot(), "/");

            Test.SetSecondShot(3);
            Assert.AreEqual(Test.PrintLastShot(), "6");
        }
示例#7
0
        //Constructor de la clase que tambien toma los valores del anterior
        public Board(Entry[] BE)
        {
            InitializeBoard();

            for (int t = 0; t < 10; t++)
            {
                Entries[t].SetFirstShot(BE[t].GetFirstShot());
                Entries[t].SetSecondShot(BE[t].GetSecondShot());
                Entries[t].SetThirdShot(BE[t].GetThirdShot());

                Entries[t].SetToAdd(BE[t].GetToAdd());
                Entries[t].SetAdded(BE[t].GetAdded());

                Entries[t].SetTotal(BE[t].GetTotal());
                if (BE[t].IsComplete()) Entries[t].Completed();
            }
        }
示例#8
0
 public void SetEntry(Entry[] BEntries)
 {
     Entries = BEntries;
 }