using System; using System.Collections.Generic; using System.Collections.Specialized; using JetBrains.Annotations; using WireMock.Admin.Mappings; using WireMock.Logging; namespace WireMock.Server { /// /// The fluent mock server interface. /// public interface IWireMockServer : IDisposable { /// /// Gets a value indicating whether this server is started. /// bool IsStarted { get; } /// /// Gets the request logs. /// IEnumerable LogEntries { get; } /// /// Gets the mappings as MappingModels. /// IEnumerable MappingModels { get; } // // Gets the mappings. // //[PublicAPI] //IEnumerable Mappings { get; } /// /// Gets the ports. /// List Ports { get; } /// /// Gets the urls. /// string[] Urls { get; } //ConcurrentDictionary Scenarios { get; } /// /// Occurs when [log entries changed]. /// event NotifyCollectionChangedEventHandler LogEntriesChanged; /// /// Adds the catch all mapping. /// void AddCatchAllMapping(); /// /// The add request processing delay. /// /// The delay. void AddGlobalProcessingDelay(TimeSpan delay); /// /// Allows the partial mapping. /// void AllowPartialMapping(bool allow = true); /// /// Deletes a LogEntry. /// /// The unique identifier. bool DeleteLogEntry(Guid guid); /// /// Deletes the mapping. /// /// The unique identifier. bool DeleteMapping(Guid guid); //IEnumerable FindLogEntries([NotNull] params IRequestMatcher[] matchers); //IRespondWithAProvider Given(IRequestMatcher requestMatcher, bool saveToFile = false); /// /// Reads a static mapping file and adds or updates the mapping. /// /// The path. bool ReadStaticMappingAndAddOrUpdate([NotNull] string path); /// /// Reads the static mappings from a folder. /// /// The optional folder. If not defined, use {CurrentFolder}/__admin/mappings void ReadStaticMappings([CanBeNull] string folder = null); /// /// Removes the basic authentication. /// void RemoveBasicAuthentication(); /// /// Resets LogEntries and Mappings. /// void Reset(); /// /// Resets the Mappings. /// void ResetMappings(); /// /// Resets all Scenarios. /// void ResetScenarios(); /// /// Resets the LogEntries. /// void ResetLogEntries(); /// /// Saves the static mappings. /// /// The optional folder. If not defined, use {CurrentFolder}/__admin/mappings void SaveStaticMappings([CanBeNull] string folder = null); /// /// Sets the basic authentication. /// /// The username. /// The password. void SetBasicAuthentication([NotNull] string username, [NotNull] string password); /// /// Sets the maximum RequestLog count. /// /// The maximum RequestLog count. void SetMaxRequestLogCount([CanBeNull] int? maxRequestLogCount); /// /// Sets RequestLog expiration in hours. /// /// The RequestLog expiration in hours. void SetRequestLogExpirationDuration([CanBeNull] int? requestLogExpirationDuration); /// /// Stop this server. /// void Stop(); /// /// Watches the static mappings for changes. /// /// The optional folder. If not defined, use {CurrentFolder}/__admin/mappings void WatchStaticMappings([CanBeNull] string folder = null); /// /// Register the mappings (via ). /// /// The MappingModels IWireMockServer WithMapping(params MappingModel[] mappings); /// /// Register the mappings (via json string). /// /// The mapping(s) as json string. IWireMockServer WithMapping(string mappings); } }