public void TestCompoundShapeClear()
        {
            // arrange
            CompoundShape compoundShape = new CompoundShape(7, 7);

            // act
            compoundShape.Add(new Line(3, 4, 5, 6));
            compoundShape.Clear();

            // assert
            Assert.AreEqual(expectedZeroCount, compoundShape.Count);
        }
Exemple #2
0
        public void TestCompoundShapeContent()
        {
            // arrange
            Line line = new Line(3, 4, 5, 6);

            // act
            int actualZeroCount  = _compoundShape.Count;
            int actualOneCount   = AddCompoundShapeAndGetCount(_line);
            int actualTwoCount   = AddCompoundShapeAndGetCount(_circle);
            int actualThreeCount = AddCompoundShapeAndGetCount(line);

            _compoundShape.Clear();
            int actualClearCount = _compoundShape.Count;

            // assert (not an optimal solution for testing, but shows a way to test with multiple asserts)
            Assert.AreEqual(expectedZeroCount, actualZeroCount);
            Assert.AreEqual(expectedOneCount, actualOneCount);
            Assert.AreEqual(expectedTwoCount, actualTwoCount);
            Assert.AreEqual(expectedThreeCount, actualThreeCount);
            Assert.AreEqual(expectedZeroCount, actualClearCount);
        }
 public void TearDown()
 {
     _compoundShape.Clear();
 }