Beispiel #1
0
        public async Task Consume(ConsumeContext <CreateInvalidRecord> context)
        {
            var invalidRecord = new InvalidRecord(context.Message.Id, context.Message.UserId, RecordType.Structure, context.Message.FileId, context.Message.Index, context.Message.Message);

            await _session.Add(invalidRecord);

            await _session.Commit();
        }
        public static void NodeShouldBeEquivalentTo(this GenericDictionaryAssertions <string, object> assertions, InvalidRecord record)
        {
            record.Should().NotBeNull();

            var expected = new Dictionary <string, object>()
            {
                { "_id", record.Id },
                { "Type", "Record" },
                { "SubType", record.RecordType.ToString() },
                { "Name", record.Index.ToString() },
                { "OwnedBy", record.OwnedBy },
                { "CreatedBy", record.CreatedBy },
                { "CreatedDateTime", record.CreatedDateTime.UtcDateTime },
                { "UpdatedBy", record.UpdatedBy },
                { "UpdatedDateTime", record.UpdatedDateTime.UtcDateTime },
                { "ParentId", record.ParentId },
                { "Index", record.Index },
                { "Status", record.Status.ToString() },
                { "Message", record.Error },
                { "Version", record.Version }
            };

            assertions.Subject.Should().BeEquivalentTo(expected);
        }