vendredi 1 juin 2018

Which design pattern to use to frame variety of test data objects where test data structure is nested arrays inside arrays

Below is the data structure.

class D {
  string d1;
  string d2;
  string d3;
};

class C {
  vector<D> d_vector;
};

class B {
  vector<C> c_vector;
};

class E {
  vector<D> ed_vector;
  int w;
};

class A {
  vector<B> b_vector;
  vector<E> e_vector;
};

So I want to test the usage of this data, so I need to different values of objects of class A, to test different scenarios. So I want to create these objects to pass for funtions in gunit tests.

So is there any design pattern which helps me here ?

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire