New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
list with different elements #31
Comments
You also can add literal values, like this: add("items", Arrays.asList("itemOne", "itemTwo")); |
@douglasrodrigo I think that @wagnerfrancisco didn't mean this. When we use has().of() we can only pass one template, I believe he wants to specify more than one template. @wagnerfrancisco am I correct? |
It's exactly that @nykolaslima ! Is it possible? |
It's not possible. But why you wanna do this? If you wanna do this because you need different data, you can use functions to generate custom data. Eg: add("email", regex("my regex to generate emails"); Using functions instead of "hard-coded" data maybe help you. This way you dont need to use two different tremplates and instead of this you can create a template that cover the 2 other templates. Sent from my iPhone On 28/06/2013, at 21:40, Wagner Francisco Mezaroba notifications@github.com wrote:
|
Hi. Actually I'm testing an xml conversion, I'm creating an object that is going to be converted to xml. This object contains a list and I just would like to ensure this list is going to be properly converted. I already had this object created without fixture-factory and now I'm justing refactoring the code. But thinking better, I really think in my case it's not necessary to have two different values in the list. Even if the objects are equal my test is going to be useful. I was just trying to get the same object I had before using fixture-factory. Thanks! |
But you can have different objects using the same template. To do this you need to use functions instead of hard coded values. Just like my examples in the other comment. Sent from my iPhone On 28/06/2013, at 23:29, Wagner Francisco Mezaroba notifications@github.com wrote:
|
@wagnerfrancisco can we close this? |
@nykolaslima and @douglasrodrigo, thanks for your help. Yes, feel free to close this. |
Just started using this framework and I didn't realize how to create a list with different elements. I think this is not possible, right? Something like this:
add("items", has(2).of(Item.class, "itemOne", "itemTwo");
The text was updated successfully, but these errors were encountered: