public void AddSaga_CreatesNewSagaRecord()
        {
            Guid sagaId      = Guid.Parse("1367F325-CF6C-4EB3-8C23-696A7135CD9A");
            Guid sagaClassId = Guid.Parse("10452E7E-4888-4EF0-BC78-D76C4D8062B5");

            sut.AddSaga(sagaId, sagaClassId);

            var metadatas = inMemoryCrudRepository.FindAllWithAdded <SagaMetadataRecord>().ToList();

            metadatas.Count.Should().Be(1);
            metadatas.Should().Contain(x => x.Id == sagaId && x.ClassId == sagaClassId);
        }
Example #2
0
        public async Task Add_AddsToRepository()
        {
            NotificationBuffer buffer = new NotificationBuffer(Guid.NewGuid(), Guid.NewGuid(),
                                                               Guid.NewGuid());

            inMemoryCrudRepository.Attach(buffer);

            DateTimeOffset now = DateTimeOffset.Now;

            await sut.Add(new SerializedNotification()
            {
                NotificationClassName = "Notification1", NotificationJson = "{}"
            },
                          buffer.Id, now, Guid.NewGuid(), Guid.NewGuid());

            Assert.Equal(1, inMemoryCrudRepository.FindAllWithAdded <BufferedNotification>().Count());
            Assert.Single(inMemoryCrudRepository.FindAllWithAdded <BufferedNotification>(),
                          x => x.NotificationClassName == "Notification1" &&
                          x.NotificationJson == "{}" &&
                          x.Buffer == buffer &&
                          x.TimeQueued == now &&
                          x.Id != Guid.Empty);
            Assert.Equal(1, inMemoryCrudRepository.FindAll <NotificationBuffer>().Count());
        }