public static void ExecuteViaReflection_void___Should_throw_ArgumentException___When_protocol_cannot_execute_operation() { // Arrange var operation = new DummyVoidOperation(); var protocol1 = new ProtocolWithNoOperations(); var protocol2 = new SiblingOperationProtocol(); // Act var actual1 = Record.Exception(() => protocol1.ExecuteViaReflection(operation)); var actual2 = Record.Exception(() => protocol2.ExecuteViaReflection(operation)); // Assert actual1.AsTest().Must().BeOfType <ArgumentException>(); actual1.Message.AsTest().Must().ContainString(Invariant($"The specified '{nameof(ProtocolExtensionsTest)}.{nameof(ProtocolWithNoOperations)}' protocol does not have a void Execute method with a single parameter that the specified '{nameof(ProtocolExtensionsTest)}.{nameof(DummyVoidOperation)}' operation is assignable to.")); actual2.AsTest().Must().BeOfType <ArgumentException>(); actual2.Message.AsTest().Must().ContainString(Invariant($"The specified '{nameof(ProtocolExtensionsTest)}.{nameof(SiblingOperationProtocol)}' protocol does not have a void Execute method with a single parameter that the specified '{nameof(ProtocolExtensionsTest)}.{nameof(DummyVoidOperation)}' operation is assignable to.")); }