Exemplo n.º 1
0
        public void GetHashCodeTest()
        {
            URational32 a = new URational32(42, 666);
            URational32 b = new URational32(42, 666);

            Assert.Equal(a.GetHashCode(), b.GetHashCode());
        }
Exemplo n.º 2
0
        public void AddTest4()
        {
            Page        target = new Page();
            TagType     Tag    = new TagType();
            URational32 value  = new URational32();

            target.Add(Tag, value);
        }
Exemplo n.º 3
0
        public void ToStringTest()
        {
            URational32 target   = new URational32(42, 666);
            string      expected = "42/666";
            string      actual   = target.ToString();

            Assert.Equal(expected, actual);
        }
Exemplo n.º 4
0
        public void YResolutionTest2()
        {
            Page        target   = new Page();
            URational32 expected = new URational32();
            URational32 actual;

            actual = target.YResolution;
            Assert.Equal(expected, actual);
        }
Exemplo n.º 5
0
        public void ReduceTest2()
        {
            URational32 target   = new URational32(9, 25);
            URational32 expected = new URational32(9, 25);
            URational32 actual;

            actual = target.Reduce();
            Assert.Equal(expected, actual);
        }
Exemplo n.º 6
0
        public void URational32ConstructorTest1()
        {
            uint        numerator   = 0;
            uint        denominator = 0;
            URational32 target      = new URational32(numerator, denominator);

            Assert.Equal(numerator, target.Numerator);
            Assert.Equal(denominator, target.Denominator);
        }
Exemplo n.º 7
0
        public void ReduceTest()
        {
            URational32 target   = new URational32(1207959552, 16777216);
            URational32 expected = new URational32(72, 1);
            URational32 actual;

            actual = target.Reduce();
            Assert.Equal(expected, actual);
        }
Exemplo n.º 8
0
        public void InverseTest()
        {
            URational32 target   = new URational32(1207959552, 16777216);
            URational32 expected = new URational32(16777216, 1207959552);
            URational32 actual;

            actual = target.Inverse();
            Assert.Equal(expected, actual);
        }
Exemplo n.º 9
0
        public void EqualsTest()
        {
            URational32 target   = new URational32();
            object      obj      = null;
            bool        expected = false;
            bool        actual;

            actual = target.Equals(obj);
            Assert.Equal(expected, actual);
        }
Exemplo n.º 10
0
        public void op_InequalityTest()
        {
            URational32 value1   = new URational32(1, 2);
            URational32 value2   = new URational32(2, 4);
            bool        expected = true;
            bool        actual;

            actual = (value1 != value2);
            Assert.Equal(expected, actual);
        }
Exemplo n.º 11
0
        public void GetBytesTest()
        {
            URational32 test = new URational32(42, 666);

            byte[] data = new byte[8];
            Array.Copy(BitConverter.GetBytes((uint)42), data, 4);
            Array.Copy(BitConverter.GetBytes((uint)666), 0, data, 4, 4);
            int         startIndex = 0;
            URational32 target     = new URational32(data, startIndex);

            Assert.Equal(data, target.GetBytes());
        }
Exemplo n.º 12
0
        public void NumeratorTest()
        {
            URational32 target = new URational32(42, 666);

            Assert.Equal(42u, target.Numerator);
        }
Exemplo n.º 13
0
        public void DenominatorTest()
        {
            URational32 target = new URational32(42, 666);

            Assert.Equal(666u, target.Denominator);
        }