lundi 26 juin 2017

FitNesse / FitSharp - Read columns of ColumnFixture dynamically

I am using the FitNesse / FitSharp (c#) for testing purposes.

I can create normal fixture like ColumnFixtures, RowFixtures, DoFixtures etc. but not I am looking for a way to read columns and bind them dynamically.

The reason for this is, I still already have a huge amount of Pojo objects in my own library and don't want to repeat all class members again. Therefor i am searching for a way to handle column dynamically.

e.g.

!|Create| pojoType | record | pojoName |
 | a    | b        | c      | d        |



public class DynamicHandling : DoFixture () {
   public void CreateRecord(string type, string name) {
      var clazz = GetClazzOfType();

      var headers = GetHeadersOfColumn();
      var values = GetValuesOfColumn();

      DoBinding(headers, rows, clazz);

      ... Continue with whatever ...
   }
}

Any idea ?

Aucun commentaire:

Enregistrer un commentaire