static void Main(string[] args) { Group group = new GroupSum(); FigureCircle fc = new FigureCircle(1); FigureSquare fs = new FigureSquare(3); FigureTriangle ft = new FigureTriangle(3, 4, 5); Group gr = new GroupSum(); gr.Add(fs); Console.WriteLine(fc.Measure()); Console.WriteLine(fs.Measure()); Console.WriteLine(ft.Measure()); Console.WriteLine(gr.Measure()); group.Add(fc); group.Add(fs); group.Add(ft); group.Add(gr); Console.WriteLine(group.Measure()); }
public void Measure_Length10() { float lenOfSide = 10; FigureSquare square = new FigureSquare(lenOfSide); float S = MathF.Pow(lenOfSide, 2); float measure = square.Measure(); Assert.AreEqual(S, measure); }
public void Measure_SumItems_OnlyFigures() { FigureSquare square = new FigureSquare(3); FigureCircle circle = new FigureCircle(3); GroupSum groupSum = new GroupSum(); groupSum.Add(square); groupSum.Add(circle); float measureItems = square.Measure() + circle.Measure(); float measureGroup = groupSum.Measure(); Assert.AreEqual(measureItems, measureGroup); }
public void Measure_MultiplyItems_OnlyFigures() { FigureSquare square = new FigureSquare(3); FigureCircle circle = new FigureCircle(3); GroupMyltiply groupMyltiply = new GroupMyltiply(); groupMyltiply.Add(square); groupMyltiply.Add(circle); float measureItems = square.Measure() * circle.Measure(); float measureGroup = groupMyltiply.Measure(); Assert.AreEqual(measureItems, measureGroup); }