Ejemplo n.º 1
0
        protected EventStoreTestContext()
        {
            Fixture = new Fixture();

            _taskCount   = 100;
            _aggregateId = Guid.NewGuid();
            _aggregate   = FakeAggregate.Create(_aggregateId, "initial text");
        }
Ejemplo n.º 2
0
        public void SaveAggregate_ToLocalStorage()
        {
            var timeProvider = new UtcTimeProvider();
            var eventStore   = new AzureTableStorageEventStore("UseDevelopmentStorage=true", timeProvider);

            var id = Guid.NewGuid();

            var aggregate = FakeAggregate.Create(id) as FakeAggregate;

            aggregate.UpdateText("Some message");

            var events = eventStore.Save(aggregate);

            Assert.AreEqual(2, events.Count());

            var retrieved = eventStore.GetById <FakeAggregate>(id);

            Assert.IsNotNull(retrieved);
            Assert.AreEqual("Some message", retrieved.Text);
        }