Exemplo n.º 1
0
        public void Write__Writing_A_Valid_RealType()
        {
            RealType realType = new RealType();
            realType.Value = 100;

            byte[] writtenData = realType.Write();
            byte[] expected = File.ReadAllBytes("Content/Tests/RealType/RealType-Data.bin");

            Assert.AreEqual(BitConverter.ToString(expected), BitConverter.ToString(writtenData));
        }
Exemplo n.º 2
0
        public void Equals__Not_Equal()
        {
            RealType realType = new RealType();
            realType.Value = 1;

            RealType other = new RealType();
            other.Value = 100;

            Assert.IsFalse(realType.Equals(other));
        }
Exemplo n.º 3
0
        public void Read__Reading_A_Valid_RealType()
        {
            byte[] data = File.ReadAllBytes("Content/Tests/RealType/RealType-Data.bin");

            RealType realType = new RealType();
            realType.Read(data);

            float epsilon = 0.0001f;
            Assert.AreEqual(100, realType.Value, epsilon);
        }
Exemplo n.º 4
0
        public void Equals()
        {
            RealType realType = new RealType();
            realType.Value = 1;

            RealType other = new RealType();
            other.Value = 1;

            Assert.IsTrue(realType.Equals(other));
        }