Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- IShape shape = new Circle(10);
- Console.WriteLine(shape.Area);
- Assert(Math.Abs(shape.Area - 314.159265358979) < 0.00000000001);
- Console.WriteLine(shape.Perimeter);
- Assert(Math.Abs(shape.Perimeter - 62.8318530718) < 0.00000000001);
- IShape shape2 = new Triangle(3,4,5);
- Console.WriteLine(shape2.Area);
- Triangle temp = (Triangle) shape2;
- if (temp.IsRight)
- Console.WriteLine("shape2 is right");
- Assert(Math.Abs(shape2.Area - 6) < 0.00000000001);
- Console.ReadLine();
- }
- }
- // Это метод Main, который я писал для тестирования библиотеки. К сожалению, проблему с красивым даункастом решить не удалось. ¯\_(ツ)_/¯
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement