Библиотека для вычисления площадей фигур:
- Круг: Circle(r)
- Треугольник: Triangle(a,b,c)
dotnet add <Consumer.csproj> reference ../src/Shapes.csproj
dotnet add reference <Shapes.dll>
dotnet pack src/Shapes.csproj -c Release -o ./nupkg dotnet nuget add source ./nupkg --name local dotnet add <Consumer.csproj> package --version 1.0.0 --source local
dotnet test -c Release
using Shapes;
IShape s1 = new Circle(1);
IShape s2 = new Triangle(3,4,5);
double a1 = s1.Area(); // π
double a2 = s2.Area(); // 6
bool right = ((Triangle)s2).IsRightAngled(); // true