Search in sources :

Example 1 with WithConstructorVariable

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"));
}
Also used : NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) WithConstructorVariable(com.spectralogic.ds3autogen.net.model.request.WithConstructorVariable) Test(org.junit.Test)

Example 2 with WithConstructorVariable

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));
}
Also used : NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) WithConstructorVariable(com.spectralogic.ds3autogen.net.model.request.WithConstructorVariable) Ds3DocSpec(com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec) Ds3DocSpecImpl(com.spectralogic.ds3autogen.docspec.Ds3DocSpecImpl) Test(org.junit.Test)

Aggregations

NetNullableVariable (com.spectralogic.ds3autogen.net.model.common.NetNullableVariable)2 WithConstructorVariable (com.spectralogic.ds3autogen.net.model.request.WithConstructorVariable)2 Test (org.junit.Test)2 Ds3DocSpec (com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec)1 Ds3DocSpecImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecImpl)1