Exemple #1
0
        /// <summary>
        /// Creates a new <see cref="AreaReportControllerTests"/> instance
        /// </summary>
        public AreaReportControllerTests()
        {
            // Configure repo mock
            this._repo = new Mock <IMatchMessageRepository>();

            // Configure service
            this._service = new MessageService(this._repo.Object);

            // Configure controller
            this._controller = new AreaReportController(this._service);
            this._controller.ControllerContext             = new ControllerContext();
            this._controller.ControllerContext.HttpContext = new DefaultHttpContext();
        }
        /// <summary>
        /// Creates a new <see cref="AreaReportControllerTests"/> instance
        /// </summary>
        public AreaReportControllerTests()
        {
            // Configure repo mock
            this._repo = new Mock <IInfectionReportRepository>();

            // Configure service
            this._service = new InfectionReportService(this._repo.Object);

            // Create AutoMapper instance
            MapperConfiguration mapperConfig = new MapperConfiguration(
                opts => opts.AddProfile <MappingProfiles>()
                );
            IMapper mapper = mapperConfig.CreateMapper();

            // Configure controller
            this._controller = new AreaReportController(mapper, this._service);
            this._controller.ControllerContext             = new ControllerContext();
            this._controller.ControllerContext.HttpContext = new DefaultHttpContext();
        }