Skip to content

Commit b5818b2

Browse files
committed
unit test for LookConfiguration.MaxResults = x
1 parent 5b0f771 commit b5818b2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Our.Umbraco.Look.Tests/QueryTests/LookQueryTests.cs

+17
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,22 @@ public void Max_Results_Value_Invalid_Negative()
8181
Assert.AreEqual(100, lookResult.TotalItemCount);
8282
Assert.AreEqual(100, lookResult.Matches.Count());
8383
}
84+
85+
[TestMethod]
86+
public void Max_Results_Configuration_Value_Valid()
87+
{
88+
LookConfiguration.MaxResults = 3; // set first so that new lookQuerys will default to using this value
89+
90+
var lookQuery = new LookQuery(TestHelper.GetSearchingContext());
91+
92+
lookQuery.NameQuery = new NameQuery(); // set a query clause so it's acutally executed
93+
94+
var lookResult = lookQuery.Search();
95+
96+
Assert.IsNotNull(lookResult);
97+
Assert.IsTrue(lookResult.Success);
98+
Assert.AreEqual(100, lookResult.TotalItemCount);
99+
Assert.AreEqual(3, lookResult.Matches.Count());
100+
}
84101
}
85102
}

0 commit comments

Comments
 (0)