Unit testing code that verifies order of method execution Say I have a piece of code

public class OrderValidator : IValidator&lt;OrderCommand&gt;
{
    private readonly IValidationService validationService;

    public OrderValidator(IValidationService validationService)
    {
        this.validationService = validationService;
    }

    public ValidationResult Validate(OrderCommand command)
    {
         var stepBuilder = this.validationService.CreateValidationStepBuilder(command);

         stepBuilder
             .AddCommandStep&lt;OrderedItemIsValid&gt;()
             .AddBreakIfNotValidStep()
             .AddCommandStep&lt;CustomerIsValid&gt;()
             .AddCommandStep&lt;CustomerAddressIsValid&gt;()
             .AddBreakIfNotValidStep()
             .AddCommandStep&lt;OrderPaymentIsValid&gt;()
             .AddCommandStep&lt;OrderPaymentSuccessful&gt;();                

         return stepBuilder.Validate();
    }
}


The purpose of the validator is to setup the various validation steps (the Add... bit). The actual task of validation is delegated to a service, which creates a step builder, which exposes a validate method. So the validation step builder has abstracted away the job of actually storing and running the steps in order away from the validator.

In my unit test for this class, I have to make sure that the validation steps have been applied in the correct order. Since that is the only responsibility of the validator class.

[Fact]
public void AssertThatStepsAreAddedInOrder()
{
    var validationStepBuilderMock = this.CreateStepBuilderMock();

    // assume step builder mock has been hooked up correctly to the validator under test at this point
    this.Validator.Validate(new OrderCommand());

    // Using NSubstitute, verify that the order of steps is correct
    Received.InOrder(() =&gt;
    {
        validationStepBuilderMock
             .AddCommandStep&lt;OrderedItemIsValid&gt;()
             .AddBreakIfNotValidStep()
             .AddCommandStep&lt;CustomerIsValid&gt;()
             .AddCommandStep&lt;CustomerAddressIsValid&gt;()
             .AddBreakIfNotValidStep()
             .AddCommandStep&lt;OrderPaymentIsValid&gt;()
             .AddCommandStep&lt;OrderPaymentSuccessful&gt;(); 
    });
}


Is this a good unit test? My colleagues have argued no since all I have done is copy and paste the steps into the test (unit test exhibits tautology). If the steps are changed, or a new one is added, then all that needs to be done is to update the test method order.

The code does look extremely similar to the validator under test due to the fluent nature of the step builder (Add... method chaining). But how else would you test for order of execution? Surely the point of a test that tests the order of code execution is to break when that order is violated?
I think your colleagues are correct in that your test looks like it is testing code written as part of your test.  Meaning code that looks similar to the production code, but isn't.  But there are things of value here to test.

You mentioned that your builder has tests around it.  I would think that these "do things execute in order" questions are best answered by testing your builder in different configurations.  the question is simply, "can the builder build things that execute in order".

Secondly, the validation service is a concrete implementation with and interface (abstraction).  You'll likely want to test the concrete implementation because it will probably (unless configured dynamically) have a very fixed set of validation rules that are set for your business needs.  Those tests become, "is my validation service catching all of the currently considered scenarios".