Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
204 views
in Technique[技术] by (71.8m points)

c# - Customise pactnet contract file name

In my pactnet consumer test, I state the contract as follows:

PactBuilder.ServiceConsumer("My.Consumer.Application")
    .HasPactWith("My.Provicer.Application");

When the contract file is generated it has the following name: my.consumer.application-my.provicer.application.json. Is it possible to customise this so it appears as My.Consumer.Application.My.Provicer.Application.json?

question from:https://stackoverflow.com/questions/65906257/customise-pactnet-contract-file-name

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

To my knowledge it's not. But why does the name of the contract file matter? It's just an artefact of the testing process that you usually ship to something like the Pact Broker or Pactflow at which point it will have the original names displayed there.

Usually, you don't even store these files in your git repository.

This being said, you could always rename the file afterwards using any tool of your choosing - Pact doesn't care about the format of the filename when verifying (if you are verifying with a local file).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...