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)); }
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); }
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); }