Skip to content
This repository was archived by the owner on Oct 21, 2018. It is now read-only.

Warning on setup overriding #16

@ghost

Description

public interface IService
{
string Do();
}

public class RhinoTest
{
[Test]
public void Test()
{
var service = MockRepository.GenerateStub();

  // in real some complex setup of bunch of mocks in separate method
  service.Stub(x => x.Do()).Return("first setup");

  // than I missed that service is already set up
  service.Stub(x => x.Do()).Return("second setup");

  var str = service.Do();
  Assert.That(str == "second setup"); // fails
}

}

Is it possible at least give a warning (or even fail a test with warning) that method Do is set up twice?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions