public InfoService_Info_Tests()
        {
            ctx    = DbContextHelper.GetContext("info");
            config = new KurzarbeitSettingsConfiguration
            {
                Started         = new DateTime(2020, 4, 20),
                SollArbeitsZeit = 38.5m,
                CoronaSoll      = new List <CoronaAusfall>
                {
                    new CoronaAusfall {
                        Ausfall = 0.2m, Bis = new DateTime(2020, 6, 1)
                    },
                    new CoronaAusfall {
                        Ausfall = 0.3m, Bis = new DateTime(2099, 1, 1)
                    }
                },
                PauseFree  = 10,
                Monday     = 8.2m,
                Tuesday    = 8.2m,
                Wednesday  = 8.2m,
                Thursday   = 8.2m,
                Friday     = 5.7m,
                CoronaDays = new List <DayOfWeek> {
                    DayOfWeek.Friday
                }
            };

            tbslogger = new NullLogger <TimeBookingsService>();
        }
예제 #2
0
 public TargetWorkTimeTests()
 {
     config = new KurzarbeitSettingsConfiguration
     {
         Started         = new DateTime(2020, 4, 20),
         SollArbeitsZeit = 38.5m,
         CoronaSoll      = new List <CoronaAusfall>
         {
             new CoronaAusfall {
                 Ausfall = 0.2m, Bis = new DateTime(2020, 6, 1)
             },
             new CoronaAusfall {
                 Ausfall = 0.3m, Bis = new DateTime(2099, 1, 1)
             }
         },
         PauseFree  = 10,
         Monday     = 8.2m,
         Tuesday    = 8.2m,
         Wednesday  = 8.2m,
         Thursday   = 8.2m,
         Friday     = 5.7m,
         CoronaDays = new List <DayOfWeek> {
             DayOfWeek.Friday
         }
     };
 }
 public CoronaServiceTests()
 {
     config = new KurzarbeitSettingsConfiguration
     {
         Started         = new DateTime(2020, 4, 20),
         SollArbeitsZeit = 38.5m,
         CoronaSoll      = new List <CoronaAusfall>
         {
             new CoronaAusfall {
                 Ausfall = 0.2m, Bis = new DateTime(2020, 6, 1)
             },
             new CoronaAusfall {
                 Ausfall = 0.3m, Bis = new DateTime(2099, 1, 1)
             }
         },
         PauseFree  = 10,
         Monday     = 8.2m,
         Tuesday    = 8.2m,
         Wednesday  = 8.2m,
         Thursday   = 8.2m,
         Friday     = 5.7m,
         CoronaDays = new List <DayOfWeek> {
             DayOfWeek.Friday
         }
     };
     fService = new FeiertagService(new FakeDateTimeProvider(new DateTime(2020, 05, 19)));
 }
 public TargetWorkTimeService(
     //ILogger<TargetWorkTimeService> logger,
     KurzarbeitSettingsConfiguration config,
     ICoronaService coronaService)
 {
     //_logger = logger;
     _config        = config;
     _coronaService = coronaService;
 }
        public static decimal GetWorkhours(this DateTime current, KurzarbeitSettingsConfiguration config)
        {
            var props = config.GetType().GetProperties();

            foreach (var p in props)
            {
                if (p.Name == current.DayOfWeek.ToString())
                {
                    return(Convert.ToDecimal(p.GetValue(config) ?? default(decimal)));
                }
            }
            return(0);
        }
예제 #6
0
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();
            services.AddServerSideBlazor();

            var kaSettings = new KurzarbeitSettingsConfiguration();

            Configuration.Bind("KurzarbeitSettings", kaSettings);
            services.AddSingleton(kaSettings);

            services.AddDbContext <ApplicationDbContext>(options =>
                                                         options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))
                                                         );

            services.AddBlazoredModal();

            services.AddScoped <IAppState, AppState>();
            services.AddScoped <IDateTimeProvider, DateTimeProvider>();
            services.AddScoped <IFeiertagService, FeiertagService>();
            services.AddScoped <ICoronaService, CoronaService>();
            services.AddScoped <ITimeBookingsService, TimeBookingsService>();
            services.AddScoped <IActualWorkTimeService, ActualWorkTimeService>();
            services.AddScoped <ITargetWorkTimeService, TargetWorkTimeService>();
        }
예제 #7
0
 public InfoService2(IActualWorkTimeService actualWorkTime, ITargetWorkTimeService targetWorkTime, KurzarbeitSettingsConfiguration config)
 {
     _actualWorkTime = actualWorkTime;
     _targetWorkTime = targetWorkTime;
     _config         = config;
 }