public void AssertCategoriasIguaisEAtualizadasAposUmaNovaPesquisa()
        {
            List<ProdutoTeste> produtos = target.Load();

            var prod1 = produtos[0];
            var prod2 = produtos[1];
            var prod3 = produtos[2];

            Assert.That(prod1.CategoriaTeste, Is.Not.EqualTo(prod2.CategoriaTeste));
            Assert.That(prod2.CategoriaTeste, Is.Not.EqualTo(prod3.CategoriaTeste));

            Assert.That(prod1.CategoriaTeste, Is.EqualTo(prod3.CategoriaTeste));

            Assert.That(prod1.CategoriaTeste.Nome, Is.EqualTo("Cereal 1"));
            Assert.That(prod3.CategoriaTeste.Nome, Is.EqualTo("Cereal 1"));

            produtoTable = new DataTable();
            SetUpColunas();
            AddRow(4, "Aveia", "Nestle", "500", "Pacote", "g", 2, "Cereal 1 Up");

            target = new EntitiesLoader<ProdutoTeste>(produtoTable);

            var prod4 = target.Load()[0];

            Assert.That(prod2.CategoriaTeste, Is.Not.EqualTo(prod1.CategoriaTeste));
            Assert.That(prod2.CategoriaTeste, Is.Not.EqualTo(prod3.CategoriaTeste));
            Assert.That(prod2.CategoriaTeste, Is.Not.EqualTo(prod4.CategoriaTeste));

            Assert.That(prod1.CategoriaTeste, Is.EqualTo(prod3.CategoriaTeste));
            Assert.That(prod1.CategoriaTeste, Is.EqualTo(prod4.CategoriaTeste));

            Assert.That(prod1.CategoriaTeste.Nome, Is.EqualTo("Cereal 1 Up"));
            Assert.That(prod3.CategoriaTeste.Nome, Is.EqualTo("Cereal 1 Up"));
            Assert.That(prod4.CategoriaTeste.Nome, Is.EqualTo("Cereal 1 Up"));
        }
Example #2
0
        public void AssertCategoriasIguaisEAtualizadasAposUmaNovaPesquisa()
        {
            List <ProdutoTeste> produtos = target.Load();

            var prod1 = produtos[0];
            var prod2 = produtos[1];
            var prod3 = produtos[2];

            Assert.That(prod1.CategoriaTeste, Is.Not.EqualTo(prod2.CategoriaTeste));
            Assert.That(prod2.CategoriaTeste, Is.Not.EqualTo(prod3.CategoriaTeste));

            Assert.That(prod1.CategoriaTeste, Is.EqualTo(prod3.CategoriaTeste));

            Assert.That(prod1.CategoriaTeste.Nome, Is.EqualTo("Cereal 1"));
            Assert.That(prod3.CategoriaTeste.Nome, Is.EqualTo("Cereal 1"));

            produtoTable = new DataTable();
            SetUpColunas();
            AddRow(4, "Aveia", "Nestle", "500", "Pacote", "g", 2, "Cereal 1 Up");

            target = new EntitiesLoader <ProdutoTeste>(produtoTable);

            var prod4 = target.Load()[0];

            Assert.That(prod2.CategoriaTeste, Is.Not.EqualTo(prod1.CategoriaTeste));
            Assert.That(prod2.CategoriaTeste, Is.Not.EqualTo(prod3.CategoriaTeste));
            Assert.That(prod2.CategoriaTeste, Is.Not.EqualTo(prod4.CategoriaTeste));

            Assert.That(prod1.CategoriaTeste, Is.EqualTo(prod3.CategoriaTeste));
            Assert.That(prod1.CategoriaTeste, Is.EqualTo(prod4.CategoriaTeste));

            Assert.That(prod1.CategoriaTeste.Nome, Is.EqualTo("Cereal 1 Up"));
            Assert.That(prod3.CategoriaTeste.Nome, Is.EqualTo("Cereal 1 Up"));
            Assert.That(prod4.CategoriaTeste.Nome, Is.EqualTo("Cereal 1 Up"));
        }
Example #3
0
        static async Task Main(string[] args)
        {
            var posts     = EntitiesLoader.LoadPosts();
            var documents = EntitiesLoader.LoadDocuments();

            EntitiesSeeder.CreateIndices();
            EntitiesSeeder.Seed(posts);
            EntitiesSeeder.Seed(documents);

            Console.WriteLine("Finished indexing.");
            // Indexing or fetching because the indexed documents are directly available for fetching.

            /*
             * Console.WriteLine("Extracting entities from ElasticSearch...");
             * var entities = await EntitiesFetcher.FetchEntities();
             * Console.WriteLine($"{entities.Count} entities were fetched from Elasticsearch.");
             */
        }
 public void SetUp()
 {
     SetUpDictionaryEntityes();
     SetUpDataTable();
     target = new EntitiesLoader<ProdutoTeste>(produtoTable);
 }
Example #5
0
 public void SetUp()
 {
     SetUpDictionaryEntityes();
     SetUpDataTable();
     target = new EntitiesLoader <Produto>(produtoTable);
 }