コード例 #1
0
        public async Task Doesnt_Include_Opted_Out_Types_In_SnapshotTypeCollection()
        {
            var superHero = new SuperHuman("Superman", "Clark Kent").TakeTypeInstanceSnapshot<SuperHuman>();
            superHero.Strength = 200;
            Debug.WriteLine(superHero.GetType().GetHashCode());
            superHero = superHero.ChangeSuperHeroName("Superdan").TakeSnapshot<SuperHuman>();
            var camera = new Camera();

            var villian = new SuperHuman("Lex Luthor", "Alexis").TakePrivateSnapshot<SuperHuman>();

            var superHeroSnapshots = await camera.GetAllSnapshots(superHero);
            var villianSnapShots = await camera.GetAllSnapshots(villian);
            var superHeroTypeCollection = camera.GetSnapShotTypeCollection(superHero);

            Assert.True(superHeroSnapshots.Count == 1);
            Assert.True(villianSnapShots.Count == 1);
            Assert.True(superHeroTypeCollection.Count == 3);
        }
コード例 #2
0
        public async Task Doesnt_Include_Opted_Out_Types_In_SnapshotTypeCollection()
        {
            var superHero = new SuperHuman("Superman", "Clark Kent").TakeTypeInstanceSnapshot <SuperHuman>();

            superHero.Strength = 200;
            Debug.WriteLine(superHero.GetType().GetHashCode());
            superHero = superHero.ChangeSuperHeroName("Superdan").TakeSnapshot <SuperHuman>();
            var camera = new Camera();

            var villian = new SuperHuman("Lex Luthor", "Alexis").TakePrivateSnapshot <SuperHuman>();

            var superHeroSnapshots = await camera.GetAllSnapshots(superHero);

            var villianSnapShots = await camera.GetAllSnapshots(villian);

            var superHeroTypeCollection = camera.GetSnapShotTypeCollection(superHero);

            Assert.True(superHeroSnapshots.Count == 1);
            Assert.True(villianSnapShots.Count == 1);
            Assert.True(superHeroTypeCollection.Count == 3);
        }
コード例 #3
0
 private SuperHuman(SuperHuman s)
     : base(s.Name)
 {
     SuperHeroName = s.SuperHeroName;
     Strength      = s.Strength;
 }
コード例 #4
0
 private SuperHuman(SuperHuman s)
     : base(s.Name)
 {
     SuperHeroName = s.SuperHeroName;
     Strength = s.Strength;
 }