private void Verify <T>() where T : IMonstersView
        {
            var slayed1 = new MonsterSlayed {
                Name = "Troll"
            };
            var slayed2 = new MonsterSlayed {
                Name = "Dragon"
            };
            var streamId = theSession.Events
                           .StartStream(slayed1, slayed2).Id;

            theSession.SaveChanges();

            var loadedView = theSession.Load <T>(streamId);

            loadedView.ShouldNotBeNull();
            loadedView !.Id.ShouldBe(streamId);
            loadedView.Monsters.ShouldHaveTheSameElementsAs("Troll", "Dragon");

            var queriedView = theSession.Query <T>()
                              .Single(x => x.Id == streamId);

            queriedView.Id.ShouldBe(streamId);
            queriedView.Monsters.ShouldHaveTheSameElementsAs("Troll", "Dragon");
        }
예제 #2
0
 public void Apply(MonsterSlayed slayed)
 {
     _monsters.Fill(slayed.Name);
 }
예제 #3
0
        public void Apply(MonsterSlayed slayed)
        {
            Monsters ??= new List <string>();

            Monsters.Fill(slayed.Name);
        }
예제 #4
0
 protected bool Equals(MonsterSlayed other)
 {
     return(QuestId.Equals(other.QuestId) && Name == other.Name);
 }