public void SetMaxTop_SetMaxTopValue() { // Arrange ODataOptions options = new ODataOptions(); Assert.Null(options.QuerySettings.MaxTop); // Guard // Act options.SetMaxTop(2); // Assert Assert.Equal(2, options.QuerySettings.MaxTop.Value); }
public void SetMaxTop_Throws_ForWrongValue() { // Arrange ODataOptions options = new ODataOptions(); // Act & Assert ArgumentOutOfRangeException exception = ExceptionAssert.Throws <ArgumentOutOfRangeException>(() => options.SetMaxTop(-2)); Assert.Contains("Value must be greater than or equal to 0", exception.Message); }