original_docstring: Writes the service unit test for a command.
docstring: Writes the service unit test for a command.
docstring_tokens: Writes the service unit test for a command .
code: def WriteServiceUnitTest(self, func, file, *extras):
      """Writes the service unit test for a command."""
  
      if func.name == 'Enable':
        valid_test = """
  TEST_P(%(test_name)s, %(name)sValidArgs) {
    SetupExpectationsForEnableDisable(%(gl_args)s, true);
    SpecializedSetup<cmds::%(name)s, 0>(true);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
  }
  """
      elif func.name == 'Disable':
        valid_test = """
  TEST_P(%(test_name)s, %(name)sValidArgs) {
    SetupExpectationsForEnableDisable(%(gl_args)s, false);
    SpecializedSetup<cmds::%(name)s, 0>(true);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
  }
  """
      else:
        valid_test = """
  TEST_P(%(test_name)s, %(name)sValidArgs) {
    EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
    SpecializedSetup<cmds::%(name)s, 0>(true);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
  }
  """
      self.WriteValidUnitTest(func, file, valid_test, *extras)
  
      invalid_test = """
  TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
    EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0);
    SpecializedSetup<cmds::%(name)s, 0>(false);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
  }
  """
      self.WriteInvalidUnitTest(func, file, invalid_test, *extras)
code_tokens: def WriteServiceUnitTest ( self , func , file , * extras ) : if func . name == 'Enable' : valid_test = """
  TEST_P(%(test_name)s, %(name)sValidArgs) {
    SetupExpectationsForEnableDisable(%(gl_args)s, true);
    SpecializedSetup<cmds::%(name)s, 0>(true);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
  }
  """ elif func . name == 'Disable' : valid_test = """
  TEST_P(%(test_name)s, %(name)sValidArgs) {
    SetupExpectationsForEnableDisable(%(gl_args)s, false);
    SpecializedSetup<cmds::%(name)s, 0>(true);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
  }
  """ else : valid_test = """
  TEST_P(%(test_name)s, %(name)sValidArgs) {
    EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
    SpecializedSetup<cmds::%(name)s, 0>(true);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
    EXPECT_EQ(GL_NO_ERROR, GetGLError());
  }
  """ self . WriteValidUnitTest ( func , file , valid_test , * extras ) invalid_test = """
  TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
    EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0);
    SpecializedSetup<cmds::%(name)s, 0>(false);
    cmds::%(name)s cmd;
    cmd.Init(%(args)s);
    EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
  }
  """ self . WriteInvalidUnitTest ( func , file , invalid_test , * extras )
short_docstring: Writes the service unit test for a command.
short_docstring_tokens: Writes the service unit test for a command .
comment: """Writes the service unit test for a command."""