Example #1
0
        public void Test3_SavePirate()
        {
            //Arrange
            Pirate testPirate = new Pirate("Joe", "Cap");

            testPirate.Save();

            //Act
            List <Pirate> result   = Pirate.GetAll();
            List <Pirate> testList = new List <Pirate> {
                testPirate
            };

            //Assert
            Assert.Equal(testList, result);
        }
Example #2
0
        public void Test4_DeleteOnePirate()
        {
            Pirate firstPirate = new Pirate("sage", "long");

            firstPirate.Save();

            Pirate secondPirate = new Pirate("blue", "short");

            secondPirate.Save();

            firstPirate.Delete();
            List <Pirate> allPirate = Pirate.GetAll();
            List <Pirate> afterDeleteFirstPirate = new List <Pirate> {
                secondPirate
            };

            Assert.Equal(afterDeleteFirstPirate, allPirate);
        }
Example #3
0
        public void Test1_DataBaseEmpty_True()
        {
            int table = Pirate.GetAll().Count;

            Assert.Equal(0, table);
        }