Search in sources :

Example 16 with NetNullableVariable

use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.

the class NetNullableVariableUtils_Test method createNullableVariable_Primitive_Test.

@Test
public void createNullableVariable_Primitive_Test() {
    final NetNullableVariable var = createNullableVariable("Name", "java.lang.Integer", false, null);
    assertThat(var.getNetType(), is("int"));
}
Also used : NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 17 with NetNullableVariable

use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.

the class NetNullableVariableUtils_Test method createNullableVariable_Array_Test.

@Test
public void createNullableVariable_Array_Test() {
    final NetNullableVariable var = createNullableVariable("Name", "array", "java.lang.Integer", true, null);
    assertThat(var.getNetType(), is("IEnumerable<int>"));
}
Also used : NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 18 with NetNullableVariable

use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.

the class NetNullableVariableUtils_Test method createNullableVariable_Enum_Test.

@Test
public void createNullableVariable_Enum_Test() {
    final NetNullableVariable var = createNullableVariable("Name", "TestEnumType", false, getTestTypeMap());
    assertThat(var.getNetType(), is("TestEnumType"));
}
Also used : NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 19 with NetNullableVariable

use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.

the class NetNullableVariableUtils_Test method createNullableVariable_Void_Test.

@Test
public void createNullableVariable_Void_Test() {
    final NetNullableVariable var = createNullableVariable("Name", "void", true, null);
    assertThat(var.getNetType(), is("bool?"));
}
Also used : NetNullableVariable(com.spectralogic.ds3autogen.net.model.common.NetNullableVariable) Test(org.junit.Test)

Example 20 with NetNullableVariable

use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable 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)24 Test (org.junit.Test)24 Ds3Param (com.spectralogic.ds3autogen.api.models.apispec.Ds3Param)8 Ds3Element (com.spectralogic.ds3autogen.api.models.apispec.Ds3Element)4 Ds3Annotation (com.spectralogic.ds3autogen.api.models.apispec.Ds3Annotation)2 WithConstructorVariable (com.spectralogic.ds3autogen.net.model.request.WithConstructorVariable)2 Ds3Type (com.spectralogic.ds3autogen.api.models.apispec.Ds3Type)1 Ds3DocSpec (com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec)1 Ds3DocSpecImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecImpl)1