예제 #1
0
        public void TestZero()
        {
            Assert.IsTrue(G1.Zero.IsValid());
            Assert.IsTrue(G1.Zero.IsZero());
            Assert.AreEqual(G1.Zero, G1.Zero);
            Assert.AreNotEqual(G1.Zero, G1.Generator);
            Assert.IsTrue(G1.Zero != G1.Generator);
            Assert.AreEqual(G1.Zero, G1.Zero + G1.Zero);
            var rnd = G1.GetGenerator() * Fr.GetRandom();

            Assert.AreEqual(G1.Zero + rnd, rnd);
            Assert.AreEqual(rnd + G1.Zero, rnd);
            Assert.AreEqual(rnd * Fr.Zero, G1.Zero);
            Assert.AreEqual(
                "G1(000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)",
                G1.Zero.ToString()
                );
            Assert.AreNotEqual(G1.Zero, G2.Zero);
        }