/// <summary>
        /// Initializes a new <see cref="InfectionReportServiceTests"/> instance
        /// </summary>
        public InfectionReportServiceTests()
        {
            // Initialize repositories
            this._repo = new Mock <IInfectionReportRepository>();

            // Create service
            this._service = new InfectionReportService(this._repo.Object);
        }
예제 #2
0
        /// <summary>
        /// Creates a new <see cref="ListControllerTests"/> instance
        /// </summary>
        public ListControllerTests()
        {
            // 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 ListController(mapper, this._service);
            this._controller.ControllerContext             = new ControllerContext();
            this._controller.ControllerContext.HttpContext = new DefaultHttpContext();
        }