   test.done()
 
 module.exports.nVarChar = (test) ->
-  colMetaData = [
-    type:
-      name: 'NVarChar'
-      dataLengthLength: 2
-  ]
+  colMetaData = [type: dataTypeByName.NVarChar]
 
   value = 'abc'
 
-  buffer = new Buffer(1 + 2 + 6)
-  pos = 0;
-
-  buffer.writeUInt8(TYPE.ROW, pos); pos++
-  buffer.writeUInt16LE(value.length * 2, pos); pos += colMetaData[0].type.dataLengthLength
-  buffer.write(value, pos, 'ucs-2'); pos += (value.length * 2)
+  buffer = new WritableBuffer(0, 'ucs2')
+  buffer.writeUInt8(TYPE.ROW)
+  buffer.writeUInt16LE(value.length * 2)
+  buffer.writeString(value)
+  buffer = buffer.data
   #console.log(buffer)
 
   token = parser(buffer, 1, colMetaData)

  test.done()

module.exports.varChar = (test) ->
  colMetaData = [
    type:
      name: 'VarChar'
      dataLengthLength: 2
  ]

  value = 'abc'

  buffer = new Buffer(1 + 2 + 3)
  pos = 0;

  buffer.writeUInt8(TYPE.ROW, pos); pos++
  buffer.writeUInt16LE(value.length, pos); pos += colMetaData[0].type.dataLengthLength
  buffer.write(value, pos, 'ascii'); pos += value.length
  #console.log(buffer)

  token = parser(buffer, 1, colMetaData)

  test.done()

module.exports.intN = (test) ->
  colMetaData = [type: dataTypeByName.IntN]

  value = 0

  buffer = new WritableBuffer(0)

  buffer.writeUInt8(TYPE.ROW)
  buffer.writeUInt8(value)
  buffer = buffer.data
  #console.log(buffer)

  token = parser(buffer, 1, colMetaData)
