Example #1
0
        public void CanGetShapeByIndex()
        {
            var draft     = new PictureDraft();
            var testShape = new TestShape();

            Assert.AreEqual(draft.ShapeCount, 0);
            draft.AddShape(testShape);
            Assert.AreEqual(draft.ShapeCount, 1);
            Assert.AreEqual(draft.GetShapeByIndex(0), testShape);
        }
Example #2
0
        public void CantGetShapeIfIndexLessThanZero()
        {
            var draft     = new PictureDraft();
            var testShape = new TestShape();

            Assert.AreEqual(draft.ShapeCount, 0);
            draft.AddShape(testShape);
            Assert.AreEqual(draft.ShapeCount, 1);
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => draft.GetShapeByIndex(-1));
        }
Example #3
0
        public void CanCreatePictureDraftAndAddShapeInIt()
        {
            var draft     = new PictureDraft();
            var testShape = new TestShape();

            Assert.AreEqual(draft.ShapeCount, 0);
            draft.AddShape(testShape);

            Assert.AreEqual(draft.ShapeCount, 1);
        }