예제 #1
0
        public async Task E_Possivel_Realizar_Gets_UF()
        {
            using (var context = _serviceProvide.GetService <MyContext>())
            {
                UfImplementation _repositorio = new UfImplementation(context);
                UfEntity         _entity      = new UfEntity
                {
                    Id    = new Guid("e7e416de-477c-4fa3-a541-b5af5f35ccf6"),
                    Sigla = "SP",
                    Nome  = "São Paulo"
                };

                var _registroExiste = await _repositorio.ExistAsync(_entity.Id);

                Assert.True(_registroExiste);

                var _registroSelecionado = await _repositorio.SelectAsync(_entity.Id);

                Assert.NotNull(_registroSelecionado);
                Assert.Equal(_entity.Sigla, _registroSelecionado.Sigla);
                Assert.Equal(_entity.Nome, _registroSelecionado.Nome);
                Assert.Equal(_entity.Id, _registroSelecionado.Id);

                var _todosRegistros = await _repositorio.SelectAsync();

                Assert.NotNull(_todosRegistros);
                Assert.True(_todosRegistros.Count() == 27);
            }
        }
예제 #2
0
        public async Task E_Possivel_Realizar_Gets_UF()
        {
            using (var context = _serviceProdive.GetService <MyContext>())
            {
                UfImplementation _repositorio = new UfImplementation(context);
                UfEntity         _entity      = new UfEntity
                {
                    Id    = new Guid("ad5969bd-82dc-4e23-ace2-d8495935dd2e"),
                    Sigla = "PE",
                    Nome  = "Pernambuco"
                };

                var _registroExiste = await _repositorio.ExistsAsync(_entity.Id);

                Assert.True(_registroExiste);

                var _registroSelecionado = await _repositorio.SelectAsync(_entity.Id);

                Assert.NotNull(_registroSelecionado);
                Assert.Equal(_entity.Nome, _registroSelecionado.Nome);
                Assert.Equal(_entity.Id, _registroSelecionado.Id);
                Assert.Equal(_entity.Sigla, _registroSelecionado.Sigla);

                var _todosRegistros = await _repositorio.SelectAsync();

                Assert.NotNull(_todosRegistros);
                Assert.True(_todosRegistros.Count() == 27);
            }
        }
예제 #3
0
        public async Task GettingUFs()
        {
            using (var context = _serviceProvide.GetService <MyContext>())
            {
                UfImplementation _repositorio = new UfImplementation(context);
                UfEntity         _entity      = new UfEntity
                {
                    Id    = new Guid("22ffbd18-cdb9-45cc-97b0-51e97700bf71"),
                    Sigla = "MT",
                    Nome  = "Mato Grosso"
                };

                var _registroExiste = await _repositorio.ExistAsync(_entity.Id);

                Assert.True(_registroExiste);

                var _registroSelecionado = await _repositorio.SelectAsync(_entity.Id);

                Assert.NotNull(_registroSelecionado);
                Assert.Equal(_entity.Sigla, _registroSelecionado.Sigla);
                Assert.Equal(_entity.Nome, _registroSelecionado.Nome);
                Assert.Equal(_entity.Id, _registroSelecionado.Id);

                var _todosRegistros = await _repositorio.SelectAsync();

                Assert.NotNull(_todosRegistros);
                Assert.True(_todosRegistros.Count() == 3); /// FIX 27 estados
            }
        }
예제 #4
0
        public async Task E_Possivel_Realizar_Gets_UF()
        {
            using (var context = _serviceProvider.GetService <MyContext>())
            {
                UfImplementation _repositorio = new UfImplementation(context);
                UfEntity         _entity      = new UfEntity
                {
                    Id    = new Guid("88970a32-3a2a-4a95-8a18-2087b65f59d1"),
                    Sigla = "RS",
                    Nome  = "Rio Grande do Sul"
                };

                var _registroExiste = await _repositorio.ExistAsync(_entity.Id);

                Assert.True(_registroExiste);

                var _registroSelecionado = await _repositorio.SelectAsync(_entity.Id);

                Assert.NotNull(_registroSelecionado);
                Assert.Equal(_entity.Sigla, _registroSelecionado.Sigla);
                Assert.Equal(_entity.Nome, _registroSelecionado.Nome);
                Assert.Equal(_entity.Id, _registroSelecionado.Id);

                var _todosRegistros = await _repositorio.SelectAsync();

                Assert.NotNull(_todosRegistros);
                Assert.True(_todosRegistros.Count() == 27);
            }
        }