Esempio n. 1
0
        public ActionResult Index(FormData formData)
        {
            figureService   = new FigureService();
            resultProcessor = new ResultProcessor();
            var result     = figureService.CalculateArea(formData);
            var resultText = resultProcessor.ProcessResult(result);

            return(Content(resultText));
        }
        public async Task CreateFigureAsyncWithInvalidData_ShouldThrowException(FigureRequest request, Type expectedException)
        {
            //arrange
            var figureRepository = new FigureRepository(null);
            var figureService    = new FigureService(figureRepository);
            var controller       = new FigureController(figureService);

            //act & assert
            var exception = await Assert.ThrowsAsync(expectedException, async() => await controller.CreateFigureAsync(request));
        }
Esempio n. 3
0
        protected FigureControllerTestsAbstract()
        {
            var figureRecord  = GetQueryableMockDbSet(_records, x => x.Id = _currentId);
            var dbContextMock = new Mock <IDatabaseContext>();

            dbContextMock.SetupGet(x => x.Figures).Returns(figureRecord);

            var figureRepository = new FigureRepository(dbContextMock.Object);
            var figureService    = new FigureService(figureRepository);

            _controller = new FigureController(figureService);
        }
        public GamePlayController()
        {
            var               churchCalculatorService = new ChurchCalculatorService();
            var               castleCalculatorService = new CastleCalculatorService();
            var               roadCalculatorService   = new RoadCalculatorService();
            IFigureService    figureService           = new FigureService();
            ICalculateService calculateService        = new CalculatorService(churchCalculatorService,
                                                                              castleCalculatorService,
                                                                              roadCalculatorService,
                                                                              figureService);

            gamePlayService = new GamePlayService(calculateService, figureService);
        }
Esempio n. 5
0
 public FigureController(FigureService figureService)
 {
     _figreService = figureService;
 }