Skip to content

MockSequence and VerifyAll #75

Open
@henriquemotaesteves

Description

@henriquemotaesteves

When using a "MockSequence" the behavior of the "VerifyAll" method is modified. Is this correct?

public interface IFoo
{
    void Do();
}

/*
 * Throws MockVerificationException
 */
var foo = new Mock<IFoo>(MockBehavior.Strict);

foo.Setup(f => f.Do());
foo.VerifyAll();

/*
 * Does not throw MockVerificationException
 */
var foo = new Mock<IFoo>(MockBehavior.Strict);
var seq = new MockSequence();

foo.InSequence(seq).Setup(f => f.Do());
foo.VerifyAll();

Back this issue
Back this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions