public void MaxSearchableValueStringSize_NegativeValue_ReturnsServerConstant() { var configuration = new Mock <ISearchConfiguration>(); configuration.Setup(a => a.MaxSearchableValueStringSize).Returns("-1"); var helper = new SearchConfigurationProvider(configuration.Object); var maxSearchableValueStringValue = helper.MaxSearchableValueStringSize; Assert.AreEqual(maxSearchableValueStringValue, ServiceConstants.MaxSearchableValueStringSize); }
public void MaxSearchItems_NegativeValue_ReturnsServerConstant() { var configuration = new Mock <ISearchConfiguration>(); configuration.Setup(a => a.MaxItems).Returns("-1"); var helper = new SearchConfigurationProvider(configuration.Object); var maxItems = helper.MaxItems; Assert.AreEqual(maxItems, ServiceConstants.MaxSearchItems); }
public void SearchTimeoutValueStringSize_NegativeValue_ReturnsServerConstant() { var configuration = new Mock <ISearchConfiguration>(); configuration.Setup(a => a.SearchTimeout).Returns("-1"); var helper = new SearchConfigurationProvider(configuration.Object); var searchTimeout = helper.SearchTimeout; Assert.AreEqual(searchTimeout, ServiceConstants.DefaultSearchTimeout); }
public void PageSize_NegativeValue_ReturnsServerConstant() { var configuration = new Mock <ISearchConfiguration>(); configuration.Setup(a => a.PageSize).Returns("-1"); var helper = new SearchConfigurationProvider(configuration.Object); var pageSize = helper.PageSize; Assert.AreEqual(pageSize, ServiceConstants.SearchPageSize); }
public void MaxSearchableValueStringSize_ValidValue_ReturnsValue() { var configuration = new Mock <ISearchConfiguration>(); var value = 10; configuration.Setup(a => a.MaxSearchableValueStringSize).Returns(value.ToString(CultureInfo.InvariantCulture)); var helper = new SearchConfigurationProvider(configuration.Object); var maxSearchableValueStringValue = helper.MaxSearchableValueStringSize; Assert.AreEqual(maxSearchableValueStringValue, value); }
public void MaxSearchItems_ValidValue_ReturnsValue() { var configuration = new Mock <ISearchConfiguration>(); configuration.Setup(a => a.MaxItems).Returns("5"); var helper = new SearchConfigurationProvider(configuration.Object); var maxItems = helper.MaxItems; Assert.AreNotEqual(maxItems, ServiceConstants.MaxSearchItems); Assert.AreEqual(maxItems, 5); }
public void SearchTimeoutValueStringSize_ValidValue_ReturnsValue() { var configuration = new Mock <ISearchConfiguration>(); var value = 10; configuration.Setup(a => a.SearchTimeout).Returns(value.ToString(CultureInfo.InvariantCulture)); var helper = new SearchConfigurationProvider(configuration.Object); var searchTimeout = helper.SearchTimeout; Assert.AreEqual(searchTimeout, value); }