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"); }
public void Apply(MonsterSlayed slayed) { _monsters.Fill(slayed.Name); }
public void Apply(MonsterSlayed slayed) { Monsters ??= new List <string>(); Monsters.Fill(slayed.Name); }
protected bool Equals(MonsterSlayed other) { return(QuestId.Equals(other.QuestId) && Name == other.Name); }