コード例 #1
0
        public void WhenIPutAFeature_ThenTheFeatureOverrideIsUpdatedAndSignalRClientsAreNotified()
        {
            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 Data.Entities.FeatureOverride {
                FeatureId = feature.FeatureId, Hostname = "Test", IsEnabled = true
            };

            _createFeatureOverride.Execute(featureOverride);

            featureOverride.Hostname = "TEST123";

            Put(featureOverride.ToContract());

            feature = _getFeature.Execute(feature.Name, application.Name);
            Assert.That(feature.FeatureOverrides[0].Hostname, Is.EqualTo("TEST123"));

            _bootstrapper
            .Resolve <IMockClient>()
            .Received()
            .updateFeatureOverride(Arg.Any <dynamic>());
        }
コード例 #2
0
        public void WhenIPutAFeature_ThenTheFeatureOverrideIsUpdatedAndSignalRClientsAreNotified()
        {
            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 Data.Entities.FeatureOverride { FeatureId = feature.FeatureId, Hostname = "Test", IsEnabled = true };
            _createFeatureOverride.Execute(featureOverride);

            featureOverride.Hostname = "TEST123";

            Put(featureOverride.ToContract());

            feature = _getFeature.Execute(feature.Name, application.Name);
            Assert.That(feature.FeatureOverrides[0].Hostname, Is.EqualTo("TEST123"));

            _bootstrapper
                .Resolve<IMockClient>()
                .Received()
                .updateFeatureOverride(Arg.Any<dynamic>());
        }