public void Setup()
        {
            var options = new DbContextOptionsBuilder <ShiftContext>()
                          .UseInMemoryDatabase(databaseName: "ShifttDatabase")
                          .Options;

            // Insert seed data into the database using one instance of the context
            shiftContext = new ShiftContext(options);
            shiftContext.Shifts.Add(new Shift {
                id = 1, employeeSlots = 6, shiftDate = DateTime.Now, workingEmployees = new List <User>()
                {
                    new User(1, "Dave", 1), new User(2, "Steve", 1)
                }
            });
            shiftContext.Shifts.Add(new Shift {
                id = 2, employeeSlots = 6, shiftDate = DateTime.Now, workingEmployees = new List <User>()
                {
                    new User(1, "Dave", 2), new User(2, "Steve", 2), new User(3, "Lisa", 2)
                }
            });
            shiftContext.Shifts.Add(new Shift {
                id = 3, employeeSlots = 6, shiftDate = DateTime.Now, workingEmployees = new List <User>()
            });
            shiftContext.SaveChanges();

            shiftManager = new ShiftManager(shiftContext);

            shiftController = new ShiftController(shiftManager);
        }
예제 #2
0
        public override object VisitShift([NotNull] ShiftContext context)
        {
            string result = "...";
            int    n      = int.Parse(context.NUMBER().ToString());

            switch (context.op.Type)
            {
            case SHIFT_LEFT:
                result = sh_left(Visit(context.expression()).ToString(), n);
                break;

            case SHIFT_RIGHT:
                result = sh_right(Visit(context.expression()).ToString(), n);
                break;
            }

            return(result);
        }
예제 #3
0
 public CentroCustoRepository(ShiftContext context) : base(context)
 {
 }
예제 #4
0
 public ClaimValueRepository(ShiftContext context) : base(context)
 {
 }
예제 #5
0
 public UnitOfWork(ShiftContext context)
 {
     _context = context;
 }
예제 #6
0
 public DCShiftsController(ShiftContext context)
 {
     _context = context;
     _calc    = new RotationCalculator();
 }
예제 #7
0
 public OrdemServicoRepository(ShiftContext context)
 {
     Context = context;
     DbSet   = Context.Set <OrdemServico>();
 }
 public DaycareSelectorController(ShiftContext context)
 {
     _context = context;
 }
예제 #9
0
 public MedicoRepository(ShiftContext context)
 {
     Context = context;
     DbSet   = Context.Set <Medico>();
 }
예제 #10
0
 public ClasseContabilRepository(ShiftContext context) : base(context)
 {
 }
예제 #11
0
 public PostoColetaRepository(ShiftContext context)
 {
     Context = context;
     DbSet   = Context.Set <PostoColeta>();
 }
예제 #12
0
 public ShiftManager(ShiftContext shiftContext)
 {
     _shiftContext = shiftContext;
 }
예제 #13
0
 public GrupoRepository(ShiftContext context) : base(context)
 {
 }
예제 #14
0
 public SituacaoRepository(ShiftContext context) : base(context)
 {
 }
예제 #15
0
 public Repository(ShiftContext context)
 {
     Db    = context;
     DbSet = Db.Set <TEntity>();
 }
예제 #16
0
 public ShiftsController(ShiftContext context, AvailabilityContext availabilityContext)
 {
     _context             = context;
     _availabilityContext = availabilityContext;
 }
예제 #17
0
 public PacienteRepository(ShiftContext context)
 {
     Context = context;
     DbSet   = Context.Set <Paciente>();
 }
예제 #18
0
 public TipoBloqueioRepository(ShiftContext context) : base(context)
 {
 }
예제 #19
0
        private ExpressionContext expression(int _p)
        {
            ParserRuleContext _parentctx = _ctx;
            int _parentState             = State;
            ExpressionContext _localctx  = new ExpressionContext(_ctx, _parentState);
            ExpressionContext _prevctx   = _localctx;
            int _startState = 2;

            EnterRecursionRule(_localctx, 2, RULE_expression, _p);
            int _la;

            try {
                int _alt;
                EnterOuterAlt(_localctx, 1);
                {
                    State = 27;
                    _errHandler.Sync(this);
                    switch (_input.La(1))
                    {
                    case SHIFT_RIGHT:
                    case SHIFT_LEFT:
                    {
                        _localctx = new ShiftContext(_localctx);
                        _ctx      = _localctx;
                        _prevctx  = _localctx;

                        State = 10;
                        ((ShiftContext)_localctx).op = _input.Lt(1);
                        _la = _input.La(1);
                        if (!(_la == SHIFT_RIGHT || _la == SHIFT_LEFT))
                        {
                            ((ShiftContext)_localctx).op = _errHandler.RecoverInline(this);
                        }
                        else
                        {
                            if (_input.La(1) == TokenConstants.Eof)
                            {
                                matchedEOF = true;
                            }

                            _errHandler.ReportMatch(this);
                            Consume();
                        }
                        State = 11; Match(NUMBER);
                        State = 12; expression(6);
                    }
                    break;

                    case UPPER:
                    case LOWER:
                    {
                        _localctx = new CaseContext(_localctx);
                        _ctx      = _localctx;
                        _prevctx  = _localctx;
                        State     = 13;
                        ((CaseContext)_localctx).op = _input.Lt(1);
                        _la = _input.La(1);
                        if (!(_la == UPPER || _la == LOWER))
                        {
                            ((CaseContext)_localctx).op = _errHandler.RecoverInline(this);
                        }
                        else
                        {
                            if (_input.La(1) == TokenConstants.Eof)
                            {
                                matchedEOF = true;
                            }

                            _errHandler.ReportMatch(this);
                            Consume();
                        }
                        State = 14; expression(5);
                    }
                    break;

                    case SUBSTRING:
                    {
                        _localctx = new SubstringContext(_localctx);
                        _ctx      = _localctx;
                        _prevctx  = _localctx;
                        State     = 15; Match(SUBSTRING);
                        State     = 16; Match(NUMBER);
                        State     = 19;
                        _errHandler.Sync(this);
                        _la = _input.La(1);
                        if (_la == COMMA)
                        {
                            {
                                State = 17; Match(COMMA);
                                State = 18; Match(NUMBER);
                            }
                        }

                        State = 21; expression(4);
                    }
                    break;

                    case OBRACKET:
                    {
                        _localctx = new BracketsContext(_localctx);
                        _ctx      = _localctx;
                        _prevctx  = _localctx;
                        State     = 22; Match(OBRACKET);
                        State     = 23; expression(0);
                        State     = 24; Match(CBRACKET);
                    }
                    break;

                    case STRING:
                    {
                        _localctx = new StringContext(_localctx);
                        _ctx      = _localctx;
                        _prevctx  = _localctx;
                        State     = 26; Match(STRING);
                    }
                    break;

                    default:
                        throw new NoViableAltException(this);
                    }
                    _ctx.stop = _input.Lt(-1);
                    State     = 34;
                    _errHandler.Sync(this);
                    _alt = Interpreter.AdaptivePredict(_input, 3, _ctx);
                    while (_alt != 2 && _alt != global::Antlr4.Runtime.Atn.ATN.InvalidAltNumber)
                    {
                        if (_alt == 1)
                        {
                            if (_parseListeners != null)
                            {
                                TriggerExitRuleEvent();
                            }
                            _prevctx = _localctx;
                            {
                                {
                                    _localctx = new Con_diffContext(new ExpressionContext(_parentctx, _parentState));
                                    PushNewRecursionContext(_localctx, _startState, RULE_expression);
                                    State = 29;
                                    if (!(Precpred(_ctx, 3)))
                                    {
                                        throw new FailedPredicateException(this, "Precpred(_ctx, 3)");
                                    }
                                    State = 30;
                                    ((Con_diffContext)_localctx).op = _input.Lt(1);
                                    _la = _input.La(1);
                                    if (!(_la == CONCANTENATE || _la == DIFFERENCE))
                                    {
                                        ((Con_diffContext)_localctx).op = _errHandler.RecoverInline(this);
                                    }
                                    else
                                    {
                                        if (_input.La(1) == TokenConstants.Eof)
                                        {
                                            matchedEOF = true;
                                        }

                                        _errHandler.ReportMatch(this);
                                        Consume();
                                    }
                                    State = 31; expression(4);
                                }
                            }
                        }
                        State = 36;
                        _errHandler.Sync(this);
                        _alt = Interpreter.AdaptivePredict(_input, 3, _ctx);
                    }
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                UnrollRecursionContexts(_parentctx);
            }
            return(_localctx);
        }
예제 #20
0
 public ConvenioRepository(ShiftContext context)
 {
     Context = context;
     DbSet   = Context.Set <Convenio>();
 }
예제 #21
0
 public EmpresaRepository(ShiftContext context) : base(context)
 {
 }
예제 #22
0
 public LogAuditoriaRepository(ShiftContext context) : base(context)
 {
 }
예제 #23
0
 public ExameRepository(ShiftContext context)
 {
     Context = context;
     DbSet   = Context.Set <Exame>();
 }