コード例 #1
0
        public void CacheItemMundane()
        {
            UUID Random1 = UUID.Random();
            UUID Random2 = UUID.Random();

            byte[]        data = new byte[0];
            CacheItemBase cb1  = new CacheItemBase(Random1.ToString(), DateTime.Now + TimeSpan.FromDays(1));
            CacheItemBase cb2  = new CacheItemBase(Random2.ToString(), DateTime.Now + TimeSpan.FromDays(1));
            CacheItemBase cb3  = new CacheItemBase(Random1.ToString(), DateTime.Now + TimeSpan.FromDays(1));

            cb1.Store(data);

            Assert.That(cb1.Equals(cb3), "cb1 should equal cb3, their uuids are the same");
            Assert.That(!cb2.Equals(cb1), "cb2 should not equal cb1, their uuids are NOT the same");
            Assert.That(cb1.IsLocked() == false, "CacheItemBase default is false");
            Assert.That(cb1.Retrieve() == null, "Virtual Retrieve method should return null");
        }
コード例 #2
0
ファイル: CacheTests.cs プロジェクト: BackupTheBerlios/seleon
        public void CacheItemMundane()
        {
            UUID Random1 = UUID.Random();
            UUID Random2 = UUID.Random();
            byte[] data = new byte[0];
            CacheItemBase cb1 = new CacheItemBase(Random1.ToString(), DateTime.Now + TimeSpan.FromDays(1));
            CacheItemBase cb2 = new CacheItemBase(Random2.ToString(), DateTime.Now + TimeSpan.FromDays(1));
            CacheItemBase cb3 = new CacheItemBase(Random1.ToString(), DateTime.Now + TimeSpan.FromDays(1));

            cb1.Store(data);

            Assert.That(cb1.Equals(cb3), "cb1 should equal cb3, their uuids are the same");
            Assert.That(!cb2.Equals(cb1), "cb2 should not equal cb1, their uuids are NOT the same");
            Assert.That(cb1.IsLocked() == false, "CacheItemBase default is false");
            Assert.That(cb1.Retrieve() == null, "Virtual Retrieve method should return null");


        }