Example #1
0
        public void SaveConfiguration()
        {
            var microPipelineComponents = new IMicroPipelineComponent[] {
                new MicroPipelineComponentDummyOne(),
                new MicroPipelineComponentDummyTwo()
            };

            var propertyBag = new PropertyBag();

            var sut = new MicroPipelineComponent {
                Components = microPipelineComponents
            };

            sut.Save(propertyBag, true, true);

            Assert.That(propertyBag.Read("Components"), Is.EqualTo(MicroPipelineComponentEnumerableConverter.Serialize(microPipelineComponents)));
        }
Example #2
0
        public void LoadConfiguration()
        {
            var microPipelineComponents = new IMicroPipelineComponent[] {
                new MicroPipelineComponentDummyOne(),
                new MicroPipelineComponentDummyTwo()
            };

            var propertyBag = new PropertyBag();

            propertyBag.Add("Enabled", true);
            propertyBag.Add("Components", MicroPipelineComponentEnumerableConverter.Serialize(microPipelineComponents));

            var sut = new MicroPipelineComponent();

            sut.Load(propertyBag, 0);

            Assert.That(sut.Components, Is.EqualTo(microPipelineComponents));
        }
Example #3
0
 /// <summary>
 /// Saves the current component configuration into the property bag
 /// </summary>
 /// <param name="propertyBag">Configuration property bag</param>
 protected override void Save(IPropertyBag propertyBag)
 {
     propertyBag.WriteProperty("Components", MicroPipelineComponentEnumerableConverter.Serialize(Components));
 }