Esempio n. 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);

            ConfigureMapp.Initialize(services);

            DomainInjection.Initialize(services);
        }
Esempio n. 2
0
        private ContactController ContactControllerTest(int qtd)
        {
            var srvCollection = new ServiceCollection();

            var mockRepo = new Mock <IContactRepositoy>();

            mockRepo.Setup(repo => repo.GetAll())
            .Returns(GetTestSessions(qtd).AsEnumerable());

            ConfigureMapp.Initialize(srvCollection);
            var mapp = DomainInjection.GetService <IMapper>(srvCollection);

            var srv = new ContactService(mockRepo.Object);
            var app = new ContactApplication(srv, mapp);

            var controller = new ContactController(app);

            return(controller);
        }