From 7bc7dba86d4d7bd3d45f8b73c53006cc7f3ef61f Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 24 Jul 2019 21:46:19 +1000 Subject: [PATCH] fixes timing issue --- .../Web/PublishedContentQueryTests.cs | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/Umbraco.Tests/Web/PublishedContentQueryTests.cs b/src/Umbraco.Tests/Web/PublishedContentQueryTests.cs index 2cff946372..a3505aeb0e 100644 --- a/src/Umbraco.Tests/Web/PublishedContentQueryTests.cs +++ b/src/Umbraco.Tests/Web/PublishedContentQueryTests.cs @@ -36,22 +36,26 @@ namespace Umbraco.Tests.Web { var indexer = new TestIndex("TestIndex", luceneDirectory, fieldNames); - //populate with some test data - indexer.IndexItem(new ValueSet("1", "content", new Dictionary + using (indexer.ProcessNonAsync()) { - [fieldNames[0]] = "Hello world, there are products here", - [UmbracoContentIndex.VariesByCultureFieldName] = "n" - })); - indexer.IndexItem(new ValueSet("2", "content", new Dictionary - { - [fieldNames[1]] = "Hello world, there are products here", - [UmbracoContentIndex.VariesByCultureFieldName] = "y" - })); - indexer.IndexItem(new ValueSet("3", "content", new Dictionary - { - [fieldNames[2]] = "Hello world, there are products here", - [UmbracoContentIndex.VariesByCultureFieldName] = "y" - })); + //populate with some test data + indexer.IndexItem(new ValueSet("1", "content", new Dictionary + { + [fieldNames[0]] = "Hello world, there are products here", + [UmbracoContentIndex.VariesByCultureFieldName] = "n" + })); + indexer.IndexItem(new ValueSet("2", "content", new Dictionary + { + [fieldNames[1]] = "Hello world, there are products here", + [UmbracoContentIndex.VariesByCultureFieldName] = "y" + })); + indexer.IndexItem(new ValueSet("3", "content", new Dictionary + { + [fieldNames[2]] = "Hello world, there are products here", + [UmbracoContentIndex.VariesByCultureFieldName] = "y" + })); + } + return indexer; } @@ -80,7 +84,7 @@ namespace Umbraco.Tests.Web { var fieldNames = new[] { "title", "title_en-us", "title_fr-fr" }; using (var indexer = CreateTestIndex(luceneDir, fieldNames)) - { + { var pcq = CreatePublishedContentQuery(indexer); var results = pcq.Search("Products", culture, "TestIndex");