예제 #1
0
        public void IsRipeAtOutOfRangeTest()
        {
            // arrange
            TomatoeBox tomatoeBox = new TomatoeBox(4);

            tomatoeBox.RipeAt(0);

            // assert
            Assert.AreEqual(false, tomatoeBox.IsRipeAt(-1));
            Assert.AreEqual(false, tomatoeBox.IsRipeAt(4));
        }
예제 #2
0
        public void CreateTomatoeBoxTest()
        {
            // arrange
            TomatoeBox tomatoeBox;

            // act
            tomatoeBox = new TomatoeBox(5);

            // assert
            Assert.AreEqual("ooooo", tomatoeBox.ToString());
        }
예제 #3
0
        public void RipeAtOutOfRangeTest()
        {
            // arrange
            TomatoeBox tomatoeBox = new TomatoeBox(4);

            // act
            tomatoeBox.RipeAt(-1);
            tomatoeBox.RipeAt(4);

            // assert
            Assert.AreEqual("oooo", tomatoeBox.ToString());
        }
예제 #4
0
        public void RipeAtTest()
        {
            // arrange
            TomatoeBox tomatoeBox = new TomatoeBox(7);

            // act
            tomatoeBox.RipeAt(0);
            tomatoeBox.RipeAt(2);
            tomatoeBox.RipeAt(6);

            // assert
            Assert.AreEqual("*o*ooo*", tomatoeBox.ToString());
        }
예제 #5
0
        public void IsRipeAtTest()
        {
            // arrange
            TomatoeBox tomatoeBox = new TomatoeBox(7);

            tomatoeBox.RipeAt(0);
            tomatoeBox.RipeAt(2);
            tomatoeBox.RipeAt(6);

            // Act as parameter 2 in assert

            // Assert
            Assert.AreEqual(true, tomatoeBox.IsRipeAt(0));
            Assert.AreEqual(false, tomatoeBox.IsRipeAt(1));
            Assert.AreEqual(true, tomatoeBox.IsRipeAt(2));
            Assert.AreEqual(false, tomatoeBox.IsRipeAt(3));
            Assert.AreEqual(false, tomatoeBox.IsRipeAt(4));
            Assert.AreEqual(false, tomatoeBox.IsRipeAt(5));
            Assert.AreEqual(true, tomatoeBox.IsRipeAt(6));
        }