Exemplo n.º 1
0
        public Boolean Equals(ICountProperty countProperty)
        {
            StaticCount staticCount = countProperty as StaticCount;

            if (staticCount == null)
            {
                return(false);
            }
            return(this.count == staticCount.count);
        }
        public void StaticCountParserTest()
        {
            StaticCount static0Count     = new StaticCount(0);
            StaticCount static939Count   = new StaticCount(939);
            StaticCount static65535Count = new StaticCount(65535);

            TestUtil.TestPropertyParser("0", static0Count);
            TestUtil.TestPropertyParser("\t\t  0 \n\n \t", static0Count);

            TestUtil.TestPropertyParser("939", static939Count);
            TestUtil.TestPropertyParser("\t\t  939 \n\n \t", static939Count);

            TestUtil.TestPropertyParser("      65535", static65535Count);
            TestUtil.TestPropertyParser("   \t\t    65535 \n   \n  \t", static65535Count);

            //
            // Test some larger static counts
            //
            for (UInt32 i = 0; i < 1000000; i += 95416)
            {
                StaticCount staticCount = (StaticCount)CountProperty.Parse(i.ToString());
                Assert.AreEqual(i, staticCount.count);
            }
        }