예제 #1
0
        public override SerializedReadModel When()
        {
            var readModel = this.Givens.OfType <ReadModel>().Single();

            var repo = new SerializingRepository <ReadModel, SerializedReadModel>(this.Repository, this.Serializer);

            repo.Save(readModel);

            return(this.Repository.GetById(TheId));
        }
        public override System.Collections.Generic.IEnumerable <object> Given()
        {
            var readModel = new ReadModel {
                Identity = TheId,
                Value1   = "SomeValue",
                Value2   = 23,
                Value3   = TheDate,
                Child    = new ChildReadModel {
                    Value1 = "Child Value",
                    Value2 = 56,
                }
            };

            var x = new SerializingRepository <ReadModel, SerializedReadModel>(this.Repository, this.Serializer);

            yield return(x.Save(readModel));
        }