public ValidRdfWithCorruptedRecordsTests(ReactionFileParserTestHarness harness, ITestOutputHelper output, ValidRdfWithCorruptedRecordsTestFixture initFixture) : base(harness, output) { Id = initFixture.Id; CorrelationId = initFixture.CorrelationId; Bucket = initFixture.Bucket; UserId = initFixture.UserId; }
public EmptyRdfTests(ReactionFileParserTestHarness harness, ITestOutputHelper output, EmptyRdfTestFixture initFixture) : base(harness, output) { Id = initFixture.Id; CorrelationId = initFixture.CorrelationId; Bucket = initFixture.Bucket; UserId = initFixture.UserId; }
public static async Task <Guid> UploadBlob(this ReactionFileParserTestHarness harness, string bucket, string fileName) { var filePath = Path.Combine(Directory.GetCurrentDirectory(), "Resources", fileName); var source = new FileStream(filePath, FileMode.Open); return(await harness.BlobStorage.AddFileAsync(fileName, source, "application/octet-stream", bucket)); }
public ReactionFileParserTest(ReactionFileParserTestHarness fixture, ITestOutputHelper output = null) { Harness = fixture; if (output != null) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .WriteTo .TestOutput(output, LogEventLevel.Verbose) .CreateLogger() .ForContext <ReactionFileParserTest>(); } }
public static async Task ParseFile(this ReactionFileParserTestHarness harness, Guid id, Guid blobId, string bucket, Guid userId, Guid correlationId) { await harness.BusControl.Publish <ParseFile>(new { Id = id, UserId = userId, BlobId = blobId, Bucket = bucket, CorrelationId = correlationId }); if (!harness.Received.Select <FileParsed>(m => m.Context.Message.CorrelationId == correlationId).Any() && !harness.Received.Select <FileParseFailed>(m => m.Context.Message.CorrelationId == correlationId).Any()) { throw new TimeoutException(); } }
public EmptyRdfTestFixture(ReactionFileParserTestHarness harness) { Bucket = UserId.ToString(); BlobId = harness.UploadBlob(Bucket, "empty.rdf").Result; harness.ParseFile(Id, BlobId, Bucket, UserId, CorrelationId).Wait(); }
public ValidRdfWithCorruptedRecordsTestFixture(ReactionFileParserTestHarness harness) { Bucket = UserId.ToString(); BlobId = harness.UploadBlob(Bucket, "ccr0401_modified_trash.rdf").Result; harness.ParseFile(Id, BlobId, Bucket, UserId, CorrelationId).Wait(); }
public NonRxnTestFixture(ReactionFileParserTestHarness harness) { Bucket = UserId.ToString(); BlobId = harness.UploadBlob(Bucket, "non-rxn.rxn").Result; harness.ParseFile(Id, BlobId, Bucket, UserId, CorrelationId).Wait(); }
public InvalidRxnTestFixture(ReactionFileParserTestHarness harness) { Bucket = UserId.ToString(); BlobId = harness.UploadBlob(Bucket, "10001_modified_trash.rxn").Result; harness.ParseFile(Id, BlobId, Bucket, UserId, CorrelationId).Wait(); }