Exemplo n.º 1
0
    public bool runTest()
    {
        Console.WriteLine(s_strTFPath + "\\" + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer);
        String strLoc          = "Loc_000oo";
        String strValue        = String.Empty;
        int    iCountErrors    = 0;
        int    iCountTestcases = 0;

        try
        {
            TypeCode ReturnValue;
            strLoc = "Loc_400vy";
            UInt16 test = 0;
            iCountTestcases++;
            ReturnValue = test.GetTypeCode();
            if (ReturnValue != TypeCode.UInt16)
            {
                ++iCountErrors;
                printerr("Error_100aa! Expected==TypeCode.UInt16 Value==" + ReturnValue);
            }
        } catch (Exception exc_general) {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + " : Error Err_8888yyy!  strLoc==" + strLoc + ", exc_general==" + exc_general.ToString());
        }
        if (iCountErrors == 0)
        {
            Console.WriteLine("paSs. " + s_strTFName + " ,iCountTestcases==" + iCountTestcases.ToString());
            return(true);
        }
        else
        {
            Console.WriteLine("FAiL! " + s_strTFName + " ,iCountErrors==" + iCountErrors.ToString() + " , BugNums?: " + s_strActiveBugNums);
            return(false);
        }
    }
        public void Test_Serialize_UInt16()
        {
            var    transcoder = new DefaultTranscoder(new ManualByteConverter());
            UInt16 data       = 5;

            var flags = new Flags
            {
                Compression = Compression.None,
                DataFormat  = DataFormat.Reserved,
                TypeCode    = data.GetTypeCode()
            };

            var expected = new byte[] { 0x00, 0x05 };
            var actual   = transcoder.Encode(data, flags);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
 public TypeCode GetTypeCode()
 {
     return(val.GetTypeCode());
 }