Example #1
0
        public void GetByEid_OEidInformadoNaoExisteTest()
        {
            var options = new DbContextOptionsBuilder <CaronaAppContext>()
                          .UseInMemoryDatabase(databaseName: "Search_fake_eid")
                          .Options;

            using (var db = new CaronaAppContext(options))
            {
                var repositorio = new ColaboradorRepositoryEF(db);
                var business    = new ColaboradorBusiness(repositorio);
                business.CadastrarColaborador(new Colaborador()
                {
                    EID = "h.xavier.correia"
                });

                var colaboradorEncontrado = business.GetByEid("i.ebrahim.dos.santos");

                Assert.IsNull(colaboradorEncontrado);
            }
        }
Example #2
0
        public void GetByEid_OEidInformadoExisteTest()
        {
            var options = new DbContextOptionsBuilder <CaronaAppContext>()
                          .UseInMemoryDatabase(databaseName: "Search_existing_eid")
                          .Options;

            using (var db = new CaronaAppContext(options))
            {
                var repositorio = new ColaboradorRepositoryEF(db);
                var business    = new ColaboradorBusiness(repositorio);
                var colaborador = new Colaborador()
                {
                    EID = "h.xavier.correia"
                };
                business.CadastrarColaborador(colaborador);

                var colaboradorEncontrado = business.GetByEid("h.xavier.correia");

                Assert.AreEqual(colaborador.EID, colaboradorEncontrado.EID);
            }
        }