public void WhenIPostAFeatureOverride_ThenItIsSavedAndSignalRClientsAreNotified() { var application = new Application { ApplicationId = 1, Name = "TestApplication1" }; _createApplication.Execute(application); var feature = new Data.Entities.Feature { ApplicationId = application.ApplicationId, Name = "Feature1" }; _createFeature.Execute(feature); var featureOverride = new FeatureOverride { FeatureId = feature.FeatureId, Hostname = "Test", IsEnabled = true }; Post(featureOverride); var response = _browser.Get("/api/feature", with => { with.Header("Accept", "application/json"); with.Query("application", application.Name); with.Query("feature", feature.Name); }); var result = JsonConvert.DeserializeObject<Contracts.Feature>(response.Body.AsString()); Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); Assert.That(result.FeatureOverrides[0].IsEnabled, Is.True); _bootstrapper .Resolve<IMockClient>() .Received() .addFeatureOverride(Arg.Any<dynamic>()); }
private void Put(FeatureOverride featureOverride) { _browser.Put("/api/featureoverrides", with => { with.Header("Content-Type", "application/json"); with.Body(JsonConvert.SerializeObject(featureOverride)); }); }