Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Should().NotThrowAfter assertion for actions #942

Merged
merged 23 commits into from Jan 11, 2019

Commits on Oct 8, 2018

  1. Add wait time to NotThrow

    This extends the NotThrow Action assertion by an overload
    which allows to specify a wait time. This asserts that the
    Action should stop throwing exceptions after the wait time
    has passed.
    frederik-h committed Oct 8, 2018
    Copy the full SHA
    0e8d5f8 View commit details
    Browse the repository at this point in the history
  2. Rename NotThrow overload with wait time

    The overload of NotThrow with waiting time is renamed
    to NotThrowAfter to emphasize its purpose.
    frederik-h committed Oct 8, 2018
    Copy the full SHA
    b7a41f8 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2018

  1. Changes requested in review of NotThrowAfter

    * Change waitTime and pollInterval to TimeSpan
    * Use Thread.Sleep instead of Task.Delay
    * Add better exception messages if waitTime or pollInterval are out of
      range
    * Add tests for invalid argument exceptions
    * Simplify tests
    frederik-h committed Oct 12, 2018
    Copy the full SHA
    2da5e3b View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2018

  1. Minor variable naming and exception message change

    * Change local variable names to start with a lower case letter
      in tests of the NotThrowAfter assertion
    * Change exception message if NotThrowAfter
    frederik-h committed Oct 13, 2018
    Copy the full SHA
    d83dd87 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2018

  1. Use portable method for sleeping in NotThrowAfter

    The implementation of NotThrowAfter uses Thread.Sleep.
    This is not supported in older .net standard versions.
    Hence, Thread.Sleep is replaced by a ManualResetEvent
    which also allows to wait for a specified time.
    frederik-h committed Oct 15, 2018
    Copy the full SHA
    b46d678 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2018

  1. Fix test name

    Test "NotThrowAfter_when_subject_is_async_it_should_not_throw"
    asserts that NotThrowAfter should throw and hence it is renamed
    accordingly.
    frederik-h committed Nov 9, 2018
    Copy the full SHA
    b6a22e1 View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2018

  1. Fix exception message in NotThrowAfter

    The messages of the exceptions that are raised
    if the TimeSpan parameters of NotThrowAfter are
    negative claim that the parameters should be
    "positive". Changed to "non-negative".
    
    Further change:
    * Minor formatting change
    frederik-h committed Nov 19, 2018
    Copy the full SHA
    5d80597 View commit details
    Browse the repository at this point in the history
  2. Revert "Use portable method for sleeping in NotThrowAfter"

    This reverts commit b46d678.
    
    NotThrowAfter has to block the current thread.
    Since Thread.Sleep() is not available on older versions
    of netstandard, the previous commit introduced a workaround.
    It seems prefarable not to use this workaround and
    disable NotThrowAfter for target frameworks that don't support
    Thread.Sleep().
    frederik-h committed Nov 19, 2018
    Copy the full SHA
    cdd339e View commit details
    Browse the repository at this point in the history
  3. Disable NotThrowAfter for netstandard < 2.0

    Older versions of netstandard don't support
    Thread.Sleep() which is required by NotThrowAfter.
    frederik-h committed Nov 19, 2018
    Copy the full SHA
    fe90171 View commit details
    Browse the repository at this point in the history
  4. Merge remote-tracking branch 'upstream/master' into NotThrow-Wait

    Merge latest changes from upstream
    frederik-h committed Nov 19, 2018
    Copy the full SHA
    a8bdaf9 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2018

  1. Minor coding style changes

    * Add braces to if
    * Invert #if condition
    frederik-h committed Nov 22, 2018
    Copy the full SHA
    a9aa045 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    cc58f1d View commit details
    Browse the repository at this point in the history
  3. Minor code formatting fixes

    Add braces to single line ifs.
    frederik-h committed Nov 22, 2018
    Copy the full SHA
    670d278 View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2018

  1. Add NotThrowAfter to FunctionAssertions

    For consistency with the ActionAssertions.
    Mirrors the implementation for Actions.
    frederik-h committed Dec 20, 2018
    Copy the full SHA
    f1525e5 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    f22fcdb View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2018

  1. Wrap assertion code of NotThrowAfter in local function

    This should make sure that exceptions will reference
    the correct part of the code.
    frederik-h committed Dec 30, 2018
    Copy the full SHA
    bb1e1a0 View commit details
    Browse the repository at this point in the history

Commits on Jan 1, 2019

  1. Increase wait times in NotThrowAfter tests

    This should help to avoid test failure on slow systems
    frederik-h committed Jan 1, 2019
    Copy the full SHA
    36a850c View commit details
    Browse the repository at this point in the history
  2. Change way NowThrowAfterAsync calls the assertion task

    Remove async/await which are not necessary here
    frederik-h committed Jan 1, 2019
    Copy the full SHA
    e3004c2 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2019

  1. Copy the full SHA
    cfc76ca View commit details
    Browse the repository at this point in the history

Commits on Jan 6, 2019

  1. Increase wait time in NotThrowAfter-tests

    The wait times of two tests were too low.
    This caused the tests to fail on a slow system.
    frederik-h committed Jan 6, 2019
    Copy the full SHA
    40258c0 View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2019

  1. Fixup whitespace

    jnyrup committed Jan 7, 2019
    Copy the full SHA
    7da866c View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2019

  1. Merge pull request #1 from jnyrup/NotBeInDescendingOrder

    Fixup whitespace
    frederik-h committed Jan 8, 2019
    Copy the full SHA
    ccfeeca View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2019

  1. Change NotThrowAfter for Func<T> to return result

    Previously, the return type of NotThrowAfter for Func<T>
    was void. Now we return the result of the executed
    func to allow for further assertions on that result.
    frederik-h committed Jan 9, 2019
    Copy the full SHA
    49ec86f View commit details
    Browse the repository at this point in the history