public void Nap_WithSetup_AndConfiguraiton_CreatesNewNap_WithSetupApplied_And_PluginMethodsRun() { // Arrange var setup = new NapSetup(); setup.InstallPlugin(_plugin); // Act var nap = new NapClient(_config, setup); var request = nap.Get("test"); // Assert Assert.Same(_config, nap.Config); A.CallTo(() => _plugin.Configure(A <INapConfig> ._)).MustHaveHappened(); A.CallTo(() => _plugin.Prepare(A <NapRequest> ._)).MustNotHaveHappened(); A.CallTo(() => _plugin.Execute <Result>(A <INapRequest> ._)).MustNotHaveHappened(); A.CallTo(() => _plugin.Process(A <NapResponse> ._)).MustNotHaveHappened(); }
/// <summary> /// Initializes a new instance of the <see cref="NapClient" /> class. /// </summary> /// <param name="config">The initial configuration to utilize on creation.</param> /// <param name="setup">The setup to utilize during creation of any requests, or operation of the Nap library.</param> public NapClient(INapConfig config, NapSetup setup) : this(config.BaseUrl) { _setup = setup; _config = Configure(config); }
/// <summary> /// Initializes a new instance of the <see cref="NapClient" /> class. /// </summary> /// <param name="setup">The setup to utilize during creation of any requests, or operation of the Nap library.</param> public NapClient(NapSetup setup) : this() { _setup = setup; }
public NapSetupTests() { _napSetup = new NapSetup(); }
// Tests to ensure that *.config files get parsed correctly. public NapConfigurationTests() { _setup = new NapSetup(); _setup.InstallPlugin <NapConfigurationPlugin>(); }