use of com.spectralogic.ds3autogen.net.model.request.WithConstructorVariable in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method toWithConstructorList_FullList_Test.
@Test
public void toWithConstructorList_FullList_Test() {
final ImmutableList<NetNullableVariable> vars = ImmutableList.of(new NetNullableVariable("GuidVar", "Guid", true, true), new NetNullableVariable("IntVar", "int", true, true));
final ImmutableList<WithConstructorVariable> result = toWithConstructorList(vars, "requestName", getTestDocSpec());
assertThat(result.size(), is(3));
assertThat(result.get(0).getName(), is("GuidVar"));
assertThat(result.get(0).getType(), is("Guid"));
assertThat(result.get(1).getName(), is("GuidVar"));
assertThat(result.get(1).getType(), is("string"));
assertThat(result.get(2).getName(), is("IntVar"));
assertThat(result.get(2).getType(), is("int"));
}
use of com.spectralogic.ds3autogen.net.model.request.WithConstructorVariable in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method toWithConstructor_Test.
@Test
public void toWithConstructor_Test() {
final String expectedDoc = "/// <summary>\n" + " /// This is how you use Test Request\n" + " /// </summary>\n" + " /// <param name=\"TestParam\">This is how you use Test Param</param>\n";
final String requestName = "TestRequest";
final String paramName = "TestParam";
final Ds3DocSpec docSpec = new Ds3DocSpecImpl(ImmutableMap.of(requestName, "This is how you use Test Request"), ImmutableMap.of(paramName, "This is how you use Test Param"));
final NetNullableVariable netVar = new NetNullableVariable(paramName, "int", true, true);
final WithConstructorVariable result = toWithConstructor(netVar, requestName, docSpec);
assertThat(result.getName(), is(netVar.getName()));
assertThat(result.getType(), is(netVar.getType()));
assertThat(result.getNetType(), is(netVar.getNetType()));
assertThat(result.getDocumentation(), is(expectedDoc));
}
Aggregations