Beispiel #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            // In production, the Angular files will be served from this directory
            services.AddSpaStaticFiles(configuration =>
            {
                configuration.RootPath = "ClientApp/dist";
            });

            var salesCsvPath    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"sales-example.csv");;
            var salesRepository = new SalesRepository();

            salesRepository.SetFilePath(salesCsvPath);

            var vehicleReportProvider = new VehicleReportProvider(salesRepository);

            services.AddSingleton <ISalesProvider>(salesRepository);
            services.AddSingleton <IVehicleReportProvider>(vehicleReportProvider);
        }
        public void Setup()
        {
            var salesRepositoryMoq = new SalesRepositoryMoq();

            _repository = new VehicleReportProvider(salesRepositoryMoq);
        }