public void OneTimeSetUp() { _pactBuilder = new PactBuilder(new PactConfig { SpecificationVersion = "2.0.0" }); _pactBuilder.ServiceConsumer("Consumer App").HasPactWith("Provider API"); _mockProviderService = _pactBuilder.MockService(MockServerPort); }
public void OneTimeSetUp() { _pactBuilder = new PactBuilder(new PactConfig { PactDir = @"c:\temp\pact\pactDir", LogDir = @"c:\temp\pact\logs" }); _pactBuilder .ServiceConsumer(nameof(PactConsumer)) .HasPactWith("PactProducer"); _mockProviderService = _pactBuilder.MockService(MockServerPort); _mockProviderService.ClearInteractions(); }
public APIPact() { _pactBuilder = new PactBuilder(new PactConfig { PactDir = @"..\..\..\..\pacts", LogDir = @"..\..\..\..\logs" }); _pactBuilder.ServiceConsumer("Consumer").HasPactWith("API"); MockProviderService = _pactBuilder.MockService(MockServerPort); }
public static IMockProviderService GetMockProviderService(this IPactBuilder pactBuilder) { var configuration = new Configuration(); var mockService = pactBuilder.MockService( configuration.MockProviderServerPort, new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver() }); mockService.ClearInteractions(); return(mockService); }
public ConsumerApiMock() { var pactConfig = new PactConfig { SpecificationVersion = "2.0.0", LogDir = $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}logs{Path.DirectorySeparatorChar}", PactDir = $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}pacts{Path.DirectorySeparatorChar}" }; _pactBuilder = new PactBuilder(pactConfig) .ServiceConsumer("SomethingApiClient") .HasPactWith("GetSomething"); MockProviderService = _pactBuilder.MockService(MockServerPort, false, IPAddress.Any); }
public void FixtureSetup() { var pactConfig = new PactConfig { PactDir = $"{ PactConstants.PactRootLocation}\\{PactConstants.PactProviderNames.SqsPocApi}\\{PactConstants.PactConsumerNames.Product}", LogDir = $"{ PactConstants.PactRootLocation }\\logs" }; _pactBuilder = new PactBuilder(pactConfig); _pactBuilder .ServiceConsumer(PactConstants.PactConsumerNames.Product) .HasPactWith(PactConstants.PactProviderNames.SqsPocApi); _mockProviderService = _pactBuilder.MockService( MockSqsApiPort, Constants.JsonSettings); }
public ValuesApiMock() { var pactConfig = new PactConfig { SpecificationVersion = "2.0.0", PactDir = @"..\..\..\pact", LogDir = @".\pact_logs" }; _pactBuilder = new PactBuilder(pactConfig) .ServiceConsumer("Values") .HasPactWith("otherApi"); MockProviderService = _pactBuilder.MockService(ServicePort, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); }
public void StartMockService() { Port = int.Parse(Config["providerService:port"]); MockProviderService = PactBuilder.MockService(Port); MockProviderService.ClearInteractions(); }
private ServiceAccessPact() { MockProviderService = PactBuilder.MockService(MockServerPort); }