Exemplo n.º 1
0
        public RestauranteController(IConfiguration configuration)
        {
            Configuration = configuration;
            string connectionString = Configuration["ConnectionStrings:DefaultConnection"];

            _restauranteService = new RestauranteService(connectionString);
        }
Exemplo n.º 2
0
        void InitContext()
        {
            DbContextOptionsBuilder <DataContext> builder = new DbContextOptionsBuilder <DataContext>()
                                                            .UseSqlServer("Data Source=LAPTOP-DO-JOHAM;Initial Catalog=cedro_db;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False")
                                                            .ConfigureWarnings(x => x.Ignore(InMemoryEventId.TransactionIgnoredWarning));

            context = new DataContext(builder.Options);
            service = new RestauranteService(context);
        }
Exemplo n.º 3
0
        public void TestCadastroCall1TimeAdd()
        {
            var restauranteRepositorio = Substitute.For <IRestauranteRepositorio>();
            var restauranteService     = new RestauranteService(restauranteRepositorio);

            // setup
            var restaurante = new Restaurante {
                Nome = "Italy"
            };
            var expectedCalls = 1;

            // act
            restauranteService.Cadastro(restaurante);

            // assert
            restauranteRepositorio.ReceivedWithAnyArgs(expectedCalls).Add(restaurante);
        }
Exemplo n.º 4
0
 private void InicializaConexao()
 {
     TConexao.Open();
     _service            = new PratoService(TConexao.unitofWork, TConexao.context);
     _serviceRestaurante = new RestauranteService(TConexao.unitofWork, TConexao.context);
 }
 public RestauranteController(PersonaContext context, IHubContext <SignalHub> hubContext)
 {
     _restauranteService = new RestauranteService(context);
     _hubContext         = hubContext;
 }
Exemplo n.º 6
0
 public RestauranteController(LogisticaSinuContext context)
 {
     _restauranteService = new RestauranteService(context);
 }
 public RestauranteController(PersonaContext context)
 {
     _restauranteService = new RestauranteService(context);
 }
Exemplo n.º 8
0
 public RestaurantesController(RestauranteService restauranteService, CardápioFactory cardápioFactory)
 {
     RestauranteService   = restauranteService;
     this.cardápioFactory = cardápioFactory;
 }
 public RestauranteController(DataContext context)
 {
     service = new RestauranteService(context);
 }
Exemplo n.º 10
0
 public RestaurantesController(RestauranteService restService, IHttpContextAccessor httpcontext)
 {
     _restService = restService;
     _httpcontext = httpcontext;
 }
Exemplo n.º 11
0
 public PedidosController(RestauranteService restauranteService, PedidoFactory pedidoFactory)
 {
     RestauranteService = restauranteService;
     PedidoFactory      = pedidoFactory;
 }