Example #1
0
        public void TestConvertNull()
        {
            string            s  = null;
            TinyType <string> tt = s;

            Assert.AreEqual(s, (string)tt);
        }
Example #2
0
 /// <summary>
 /// Creates a new general purpose packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_TINY(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     SubT = (TinyType)reader.ReadByte();
 }
        public void TestSimpleIntNrOperatorEqualWorks()
        {
            int            nr  = 7;
            TinyType <int> tt1 = nr;

            Assert.AreEqual(tt1, nr);
            Assert.IsTrue(tt1 == nr);
        }
        public void TestSimpleIntOperatorEqual()
        {
            int            nr  = 7;
            TinyType <int> tt1 = nr;
            TinyType <int> tt2 = nr;

            Assert.AreEqual(tt1, tt2);
            Assert.IsFalse(tt1 == tt2);
        }
        public void TestSimpleStringOperatorEqual()
        {
            string            s   = "http://msprogrammer.serviciipeweb.ro";
            TinyType <string> tt1 = s;
            TinyType <string> tt2 = s;

            Assert.AreEqual(tt1, tt2);
            Assert.IsFalse(tt1 == tt2);
        }
        /// <summary>
        /// Creates a new general purpose packet.
        /// </summary>
        /// <param name="buffer">A buffer contaning the packet data.</param>
        public IS_TINY(byte[] buffer)
            : this()
        {
            PacketReader reader = new PacketReader(buffer);

            Size = reader.ReadByte();
            Type = (PacketType)reader.ReadByte();
            ReqI = reader.ReadByte();
            SubT = (TinyType)reader.ReadByte();
        }
Example #7
0
        public void TestConvert()
        {
            string            s  = "http://msprogrammer.serviciipeweb.ro";
            TinyType <string> tt = s;

            Assert.AreEqual(s, (string)tt);

            int            nr  = 7;
            TinyType <int> tt1 = nr;

            Assert.AreEqual(nr, (int)tt1);
        }
Example #8
0
 public void TestSimpleStringEquals()
 {
     #region arrange
     string s = "http://msprogrammer.serviciipeweb.ro";
     #endregion
     #region act
     TinyType <string> tt1 = s;
     TinyType <string> tt2 = s;
     #endregion
     #region assert
     Assert.IsTrue(tt1.Equals(tt2));
     Assert.AreEqual(tt1, tt2);
     Assert.AreEqual <string>(tt1, tt2);
     Assert.AreEqual <TinyType <string> >(tt1, tt2);
     Assert.AreEqual <string>(s, tt2);
     #endregion
 }
Example #9
0
 public void TestSimpleStringNull()
 {
     #region arrange
     string s = null;
     #endregion
     #region act
     TinyType <string> tt1 = s;
     TinyType <string> tt2 = s;
     #endregion
     #region assert
     Assert.IsTrue(tt1.Equals(tt2));
     Assert.AreEqual(tt1, tt2);
     Assert.AreEqual <string>(tt1, tt2);
     Assert.AreEqual <TinyType <string> >(tt1, tt2);
     Assert.AreEqual <string>(s, tt2);
     #endregion
 }
Example #10
0
        public void TestSimpleIntEquals()
        {
            #region arrange
            int s = 1;
            #endregion
            #region act
            TinyType <int> tt1 = s;
            TinyType <int> tt2 = s;
            #endregion
            #region assert
            Assert.IsTrue(tt1.Equals(tt2));
            Assert.AreEqual(tt1, tt2);
            Assert.AreEqual <int>(tt1, tt2);
            Assert.AreEqual <TinyType <int> >(tt1, tt2);
            Assert.AreEqual <int>(s, tt2);

            #endregion
        }
Example #11
0
 public IS_TINY(byte[] data) {
     Size = data[0];
     Type = (PacketType)data[1];
     ReqI = data[2];
     SubT = (TinyType)data[3];
 }
Example #12
0
 public void Request(TinyType tinyType) {
     HandleSend(new IS_TINY { ReqI = RequestId, SubT = tinyType });
 }
 public TinyRequestEventArgs(TinyType tiny) {
     Tiny = tiny;
 }