Exemplo n.º 1
0
        public void TestAccessors()
        {
            var c = new ComplexOf <byte>(1, 2);

            Assert.That(c.Real, Is.EqualTo(1));
            Assert.That(c.Imaginary, Is.EqualTo(2));
        }
Exemplo n.º 2
0
        public void TestGetHashCode()
        {
            var c1 = new ComplexOf <byte>(1, 2);
            var c2 = new ComplexOf <byte>(1, 2);
            var h1 = c1.GetHashCode();
            var h2 = c2.GetHashCode();

            Assert.That(h1, Is.EqualTo(h2));
        }
Exemplo n.º 3
0
        public void TestEquals()
        {
            var c1 = new ComplexOf <byte>(1, 2);
            var c2 = new ComplexOf <byte>(3, 4);
            var c3 = new ComplexOf <byte>(1, 2);

            Assert.That(c1 == c3, Is.True);
            Assert.That(c1 != c2, Is.True);
            Assert.That(c2 != c3, Is.True);
        }