示例#1
0
        public void RemoveSpaceShipByIdTest()
        {
            SpaceShipDAO target    = new SpaceShipDAO();
            SpaceShip    spaceShip = CreateSpaceShip();

            target.InsertSpaceShip(spaceShip);

            SpaceShip actual = target.GetSpaceShipById(spaceShip.SpaceShipId);

            Assert.IsNotNull(actual);

            target.RemoveSpaceShipById(spaceShip.SpaceShipId);
            Assert.IsNull(target.GetSpaceShipById(spaceShip.SpaceShipId));
        }
示例#2
0
        public void UpdateSpaceShipByIdTest()
        {
            SpaceShipDAO target    = new SpaceShipDAO();
            SpaceShip    spaceShip = CreateSpaceShip();
            bool         result    = target.InsertSpaceShip(spaceShip);

            Assert.IsTrue(result);

            SpaceShip actual = target.GetSpaceShipById(spaceShip.SpaceShipId);


            spaceShip.IsFlying          = false;
            spaceShip.DamagePercent     = 70;
            spaceShip.CurrentStarSystem = "Mars";
            target.UpdateSpaceShipById(spaceShip);

            SpaceShip compare = target.GetSpaceShipById(spaceShip.SpaceShipId);

            Assert.IsTrue(compare.IsFlying.Equals(false) & compare.DamagePercent == 70
                          & compare.CurrentStarSystem.Equals("Mars"));

            target.RemoveSpaceShipById(spaceShip.SpaceShipId);
        }
示例#3
0
        public void InsertSpaceShipTest()
        {
            SpaceShipDAO target    = new SpaceShipDAO();
            SpaceShip    spaceShip = CreateSpaceShip();
            bool         result    = target.InsertSpaceShip(spaceShip);

            Assert.IsTrue(result);

            SpaceShip actual = target.GetSpaceShipById(spaceShip.SpaceShipId);

            Assert.IsNotNull(actual);

            target.RemoveSpaceShipById(spaceShip.SpaceShipId);
        }