示例#1
0
 public void TestScaleSquare200Percent()
 {
     Square square = new Square(10);
     square.Scale(200);
     Assert.AreEqual(20, square.Height);
     Assert.AreEqual(20, square.Width);
 }
示例#2
0
 public void TestScaleSquare37Percent()
 {
     Square square = new Square(15);
     square.Scale(37);
     Assert.AreEqual((decimal) 5.55, square.Height);
     Assert.AreEqual((decimal) 5.55, square.Width);
 }
示例#3
0
        private void PopulateTestShapes()
        {
            var square = new Square(30);
            square.FillColor = Colors.AliceBlue;
            square.BorderColor = Colors.BurlyWood;

            var square2 = new Square(200);
            square2.BorderColor = Colors.Navy;
            square2.FillColor = Colors.Fuchsia;
            square.DrawOnto(ShapeCanvas, 1, 50);
            square.DrawOnto(ShapeCanvas, 50, 5);
        }
示例#4
0
 public void TestSquareConstructor()
 {
     Square square = new Square(40);
     Assert.AreEqual(40, square.Height);
     Assert.AreEqual(40, square.Width);
 }
示例#5
0
 public void TestSquareArea()
 {
     Square square = new Square(15);
     Assert.AreEqual(225, square.Area());
 }
示例#6
0
 public void TestScaleSquareToNegativePercent()
 {
     Square square = new Square(15);
     square.Scale(-10);
 }
示例#7
0
 public void TestScaleSquareTo0Percent()
 {
     Square square = new Square(15);
     square.Scale(0);
 }
示例#8
0
 public void TestDefaultColors()
 {
     Square shape = new Square(15);
     Assert.AreEqual(Colors.Bisque, shape.FillColor);
     Assert.AreEqual(Colors.Tomato, shape.BorderColor);
 }
示例#9
0
 public void TestBiggerSquarePerimeter()
 {
     Square square = new Square(10);
     Assert.AreEqual(40, square.Perimeter());
 }
示例#10
0
 public void TestBiggerSquareArea()
 {
     Square square = new Square(10);
     Assert.AreEqual(100, square.Area());
 }
示例#11
0
 public void TestSquareSides()
 {
     Square square = new Square(15);
     Assert.AreEqual(4, square.SidesCount);
 }
示例#12
0
 public void TestSquarePerimeter()
 {
     Square square = new Square(15);
     Assert.AreEqual(60, square.Perimeter());
 }
示例#13
0
 public void TestSquareArea()
 {
     Square testSquare = new Square();
     Assert.IsTrue(testSquare.calculateOutput(new[] { 2, 4 }) == 8.00);
 }