Beispiel #1
0
        public void TestSquareOccupiedFireHere()
        {
            Square square = new Square();
            square.setState(State.miss);

            Assert.IsTrue(square.fireHere());
        }
Beispiel #2
0
        public void TestSquareGetterAndSetter()
        {
            Square square = new Square();
            Random r = new Random();
            int n = r.Next(-1, 100);
            int m = r.Next(-1, 100);

            square.setXLoc(n);
            square.setYLoc(m);
            square.setState(State.hit);
            Assert.IsTrue(square.getXLoc().Equals(n));
            Assert.IsTrue(square.getYLoc().Equals(m));
            Assert.IsTrue(square.getSquareState().Equals(State.hit));
        }
Beispiel #3
0
        public void TestSquareIsOccuppied()
        {
            Square square = new Square();
            square.setState(State.miss);

            Assert.IsTrue(square.isOccuppied());
        }