Exemplo n.º 1
0
        protected override void Given()
        {
            id = new CollectionIdentity("1");
            usId = new UserStoryIdentity("3");

            collectionState = new CollectionState(new List<IEvent>(){new CollectionCreated("1","To Do", 1), new UserStoryAdded("2")});
            collection = new MyCollection(collectionState);
        }
Exemplo n.º 2
0
        public static async ETTask <long> GetIncrementId <T>(this DBComponent self)
        {
            var collection        = self.GetCollection <CollectionIdentity>();
            CollectionIdentity id = await collection.FindOneAndUpdateAsync(Builders <CollectionIdentity> .Filter.Eq(f => f.Id, typeof(T).Name),
                                                                           Builders <CollectionIdentity> .Update.Inc(f => f.Value, 1), options);

            return(id.Value);
        }
        protected override void Given()
        {
            Identity = new CollectionIdentity("1");

            eventStore = new InMemoryEventStore();
            eventsPublisher = new InMemoryPublisher();

            service = new CollectionService(eventStore, eventsPublisher);
        }
Exemplo n.º 4
0
 protected override void Given()
 {
     identity = new CollectionIdentity("1");
     collectionState = new CollectionState(new List<IEvent>());
     collection = new MyCollection(collectionState);
 }
Exemplo n.º 5
0
        public void Create(CollectionIdentity identity, string name, int wipLimit)
        {
            var created = new CollectionCreated(identity.Id, name, wipLimit);

            Apply(created);
        }
Exemplo n.º 6
0
 public void When(CollectionCreated collectionCreated)
 {
     Identity = new CollectionIdentity(collectionCreated.Id);
     Name = collectionCreated.Name;
     WipLimit = collectionCreated.WipLimit;
 }