Allow For Classes Containing Common Properties to be Used
From, @bdirenzo:
I would love to be able to have a separate class full of test-settings properties, then include a single property of that class type into a test step implementation, and the test step displays all properties contained within the separate class.
This will allow me to reuse common groupings of test properties across multiple test step types. I currently try to accomplish this reusability goal via inheritance, however I often would prefer "composition over inheritance".
For example:
public class CommonWaveformTestSettings
{
[Display("IQ Waveform Name", Order: 2)]
public string waveformName { get; set; }
[Display("Modulation On", Order: 2.5)]
public bool modulationOn { get; set; }
[Display("Say Hello", Order: 1.5)]
[Browsable(true)]
public void Button_sayHello()
{
MessageBox.Show("Hello");
}
}
public class TestStepA : TestStep
{
CommonWaveformTestSettings waveSettings {get;set;}
[Display("Some Setting A", Order: 5)]
public double someSettingA {get;set;}
public override void Run()
{
.....
}
}
public class TestStepB : TestStep
{
CommonWaveformTestSettings waveSettings {get;set;}
[Display("Some Setting B", Order: 5)]
public double someSettingB {get;set;}
public override void Run()
{
.....
}
}
Edited by Asger Iversen