Esempio n. 1
0
        public void CanAddToCollection()
        {
            BaseBeek vol1 = new BaseBeek(BeekTypes.ShortStory);
            BaseBeek vol2 = new BaseBeek(BeekTypes.ShortStory);
            BaseBeek vol3 = new BaseBeek(BeekTypes.ShortStory);
            BaseBeek vol3Bis = new BaseBeek(BeekTypes.ShortStory);
            BaseBeek vol3B = new BaseBeek(BeekTypes.ShortStory);

            BeekCollection collection = new BeekCollection();
            vol1.AddToCollection(collection, 1, null);
            vol2.AddToCollection(collection, 2, null);
            vol3.AddToCollection(collection, 3, null);
            Assert.IsTrue(collection.Count == 3);
            Assert.IsTrue(vol1.Collection == collection);
            Assert.IsTrue(vol1.VolumeNumber == 1);
            Assert.IsTrue(vol1.TotalVolumes == 3);

            vol3Bis.AddToCollection(collection, 3, null);
            Assert.IsTrue(vol1.TotalVolumes == 3);

            vol3B.AddToCollection(collection, 3, 'B');
            Assert.IsTrue(vol1.TotalVolumes == 4);
        }
Esempio n. 2
0
 public void CanRemoveFromCollection()
 {
     BaseBeek vol1 = new BaseBeek(BeekTypes.ShortStory);
     BaseBeek vol2a = new BaseBeek(BeekTypes.ShortStory);
     BaseBeek vol2b = new BaseBeek(BeekTypes.ShortStory);
     BeekCollection collection = new BeekCollection();
     vol1.AddToCollection(collection, 1, null);
     vol2a.AddToCollection(collection, 2, 'a');
     vol2b.AddToCollection(collection, 2, 'b');
     Assert.IsTrue(vol1.Collection.Contains(vol2b));
     vol2b.RemoveFromCollection();
     Assert.IsFalse(vol1.Collection.Contains(vol2b));
     Assert.IsTrue(vol2b.VolumeNumber == 0);
 }