Exemplo n.º 1
0
        public void ReturnsRightTriangleFinderWithEvenColumnGridReference()
        {
            var moqGridReference = new Mock <IGridReference>();

            moqGridReference.Setup(x => x.Column)
            .Returns(() => 10);

            TriangleCalculatorFactory triangleFinderFactory = new TriangleCalculatorFactory();
            ITriangleCalculator       triangleFinder        = triangleFinderFactory.Make(moqGridReference.Object);

            Assert.IsType(new RightTriangleCalculator().GetType(), triangleFinder);
        }
Exemplo n.º 2
0
        public IGridShape Calculate(IGrid grid, IGridReference gridReference)
        {
            ITriangleCalculator triangleCalculator = this.CalculatorFactory.Make(gridReference);

            return(triangleCalculator.Calculate(grid, gridReference));
        }