Skip to content

Commit

Permalink
Merge 7577a09 into 49164de
Browse files Browse the repository at this point in the history
  • Loading branch information
CBrohus authored Mar 28, 2023
2 parents 49164de + 7577a09 commit ae55da6
Show file tree
Hide file tree
Showing 19 changed files with 70 additions and 70 deletions.
18 changes: 9 additions & 9 deletions source/Infrastructure/Configuration/CompositionRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,16 @@ private void AddRemoteBusinessService<TRequest, TReply>(string responseQueueName
private void AddMessageGenerationServices()
{
_services.AddScoped<DocumentFactory>();
_services.AddScoped<IMessageWriter, ConfirmChangeOfSupplierXmlMessageWriter>();
_services.AddScoped<IMessageWriter, ConfirmChangeOfSupplierXmlDocumentWriter>();
_services.AddScoped<IMessageWriter, ConfirmChangeOfSupplierJsonMessageWriter>();
_services.AddScoped<IMessageWriter, RejectRequestChangeOfSupplierXmlMessageWriter>();
_services.AddScoped<IMessageWriter, GenericNotificationMessageWriter>();
_services.AddScoped<IMessageWriter, AccountingPointCharacteristicsMessageWriter>();
_services.AddScoped<IMessageWriter, ConfirmRequestChangeAccountingPointCharacteristicsMessageWriter>();
_services.AddScoped<IMessageWriter, RejectRequestChangeAccountingPointCharacteristicsMessageWriter>();
_services.AddScoped<IMessageWriter, CharacteristicsOfACustomerAtAnApMessageWriter>();
_services.AddScoped<IMessageWriter, RejectRequestChangeOfSupplierJsonMessageWriter>();
_services.AddScoped<IMessageWriter, NotifyAggregatedMeasureDataMessageWriter>();
_services.AddScoped<IMessageWriter, RejectRequestChangeOfSupplierXmlDocumentWriter>();
_services.AddScoped<IMessageWriter, GenericNotificationXmlDocumentWriter>();
_services.AddScoped<IMessageWriter, AccountingPointCharacteristicsXmlDocumentWriter>();
_services.AddScoped<IMessageWriter, ConfirmRequestChangeAccountingPointCharacteristicsXmlDocumentWriter>();
_services.AddScoped<IMessageWriter, RejectRequestChangeAccountingPointCharacteristicsXmlDocumentWriter>();
_services.AddScoped<IMessageWriter, CharacteristicsOfACustomerAtAnApDocumentWriter>();
_services.AddScoped<IMessageWriter, RejectRequestChangeOfSupplierJsonDocumentWriter>();
_services.AddScoped<IMessageWriter, NotifyAggregatedMeasureDataXmlDocumentWriter>();
_services.AddScoped<IValidationErrorTranslator, ValidationErrorTranslator>();
_services.AddScoped<IMessageRecordParser, MessageRecordParser>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

namespace Infrastructure.OutgoingMessages.AccountingPointCharacteristics;

public class AccountingPointCharacteristicsMessageWriter : MessageWriter
public class AccountingPointCharacteristicsXmlDocumentWriter : MessageWriter
{
public AccountingPointCharacteristicsMessageWriter(IMessageRecordParser parser)
public AccountingPointCharacteristicsXmlDocumentWriter(IMessageRecordParser parser)
: base(
new DocumentDetails(
"AccountingPointCharacteristics_MarketDocument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

namespace Infrastructure.OutgoingMessages.CharacteristicsOfACustomerAtAnAp;

public class CharacteristicsOfACustomerAtAnApMessageWriter : MessageWriter
public class CharacteristicsOfACustomerAtAnApDocumentWriter : MessageWriter
{
private MessageHeader? _header;

public CharacteristicsOfACustomerAtAnApMessageWriter(IMessageRecordParser parser)
public CharacteristicsOfACustomerAtAnApDocumentWriter(IMessageRecordParser parser)
: base(
new DocumentDetails(
"CharacteristicsOfACustomerAtAnAP_MarketDocument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

namespace Infrastructure.OutgoingMessages.ConfirmRequestChangeAccountingPointCharacteristics;

public class ConfirmRequestChangeAccountingPointCharacteristicsMessageWriter : MessageWriter
public class ConfirmRequestChangeAccountingPointCharacteristicsXmlDocumentWriter : MessageWriter
{
public ConfirmRequestChangeAccountingPointCharacteristicsMessageWriter(IMessageRecordParser parser)
public ConfirmRequestChangeAccountingPointCharacteristicsXmlDocumentWriter(IMessageRecordParser parser)
: base(
new DocumentDetails(
"ConfirmRequestChangeAccountingPointCharacteristics_MarketDocument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

namespace Infrastructure.OutgoingMessages.ConfirmRequestChangeOfSupplier;

public class ConfirmChangeOfSupplierXmlMessageWriter : MessageWriter
public class ConfirmChangeOfSupplierXmlDocumentWriter : MessageWriter
{
public ConfirmChangeOfSupplierXmlMessageWriter(IMessageRecordParser parser)
public ConfirmChangeOfSupplierXmlDocumentWriter(IMessageRecordParser parser)
: base(
new DocumentDetails(
"ConfirmRequestChangeOfSupplier_MarketDocument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

namespace Infrastructure.OutgoingMessages.GenericNotification;

public class GenericNotificationMessageWriter : MessageWriter
public class GenericNotificationXmlDocumentWriter : MessageWriter
{
public GenericNotificationMessageWriter(IMessageRecordParser parser)
public GenericNotificationXmlDocumentWriter(IMessageRecordParser parser)
: base(
new DocumentDetails(
"GenericNotification_MarketDocument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@

namespace Infrastructure.OutgoingMessages.NotifyAggregatedMeasureData;

public class NotifyAggregatedMeasureDataMessageWriter : MessageWriter
public class NotifyAggregatedMeasureDataXmlDocumentWriter : MessageWriter
{
private const string ActiveEnergy = "8716867000030";

public NotifyAggregatedMeasureDataMessageWriter(IMessageRecordParser parser)
public NotifyAggregatedMeasureDataXmlDocumentWriter(IMessageRecordParser parser)
: base(
new DocumentDetails(
"NotifyAggregatedMeasureData_MarketDocument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

namespace Infrastructure.OutgoingMessages.RejectRequestChangeAccountingPointCharacteristics;

public class RejectRequestChangeAccountingPointCharacteristicsMessageWriter : MessageWriter
public class RejectRequestChangeAccountingPointCharacteristicsXmlDocumentWriter : MessageWriter
{
public RejectRequestChangeAccountingPointCharacteristicsMessageWriter(IMessageRecordParser parser)
public RejectRequestChangeAccountingPointCharacteristicsXmlDocumentWriter(IMessageRecordParser parser)
: base(
new DocumentDetails(
"RejectRequestChangeAccountingPointCharacteristics_MarketDocument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

namespace Infrastructure.OutgoingMessages.RejectRequestChangeOfSupplier;

public class RejectRequestChangeOfSupplierJsonMessageWriter : IMessageWriter
public class RejectRequestChangeOfSupplierJsonDocumentWriter : IMessageWriter
{
private const string DocumentType = "RejectRequestChangeOfSupplier_MarketDocument";
private const string TypeCode = "414";
private readonly IMessageRecordParser _parser;

public RejectRequestChangeOfSupplierJsonMessageWriter(IMessageRecordParser parser)
public RejectRequestChangeOfSupplierJsonDocumentWriter(IMessageRecordParser parser)
{
_parser = parser;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

namespace Infrastructure.OutgoingMessages.RejectRequestChangeOfSupplier;

public class RejectRequestChangeOfSupplierXmlMessageWriter : MessageWriter
public class RejectRequestChangeOfSupplierXmlDocumentWriter : MessageWriter
{
public RejectRequestChangeOfSupplierXmlMessageWriter(IMessageRecordParser parser)
public RejectRequestChangeOfSupplierXmlDocumentWriter(IMessageRecordParser parser)
: base(
new DocumentDetails(
"RejectRequestChangeOfSupplier_MarketDocument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@

namespace Tests.Infrastructure.OutgoingMessages.AccountingPointCharacteristics;

public class AccountingPointCharacteristicsDocumentWriterTests
public class AccountingPointCharacteristicsXmlDocumentWriterTests
{
private readonly AccountingPointCharacteristicsMessageWriter _messageWriter;
private readonly AccountingPointCharacteristicsXmlDocumentWriter _xmlDocumentWriter;
private readonly IMessageRecordParser _messageRecordParser;
private readonly SampleData _sampleData;
private ISchemaProvider? _schemaProvider;

public AccountingPointCharacteristicsDocumentWriterTests()
public AccountingPointCharacteristicsXmlDocumentWriterTests()
{
_messageRecordParser = new MessageRecordParser(new Serializer());
_messageWriter = new AccountingPointCharacteristicsMessageWriter(_messageRecordParser);
_xmlDocumentWriter = new AccountingPointCharacteristicsXmlDocumentWriter(_messageRecordParser);
_sampleData = new SampleData();
}

Expand All @@ -55,7 +55,7 @@ public async Task Document_is_valid()
{
marketActivityRecord,
};
var message = await _messageWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList()).ConfigureAwait(false);
var message = await _xmlDocumentWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList()).ConfigureAwait(false);
await AssertMessage(message, header, marketActivityRecords).ConfigureAwait(false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@

namespace Tests.Infrastructure.OutgoingMessages.CharacteristicsOfACustomerAtAnAP
{
public class CharacteristicsOfACustomerAtAnApDocumentWriterTests : IClassFixture<DocumentValidationFixture>
public class CharacteristicsOfACustomerAtAnApXmlDocumentWriterTests : IClassFixture<DocumentValidationFixture>
{
private const string NamespacePrefix = "cim";
private readonly CharacteristicsOfACustomerAtAnApMessageWriter _messageWriter;
private readonly CharacteristicsOfACustomerAtAnApDocumentWriter _documentWriter;
private readonly ISystemDateTimeProvider _systemDateTimeProvider;
private readonly IMessageRecordParser _messageRecordParser;
private readonly DocumentValidationFixture _documentValidation;

public CharacteristicsOfACustomerAtAnApDocumentWriterTests(DocumentValidationFixture documentValidation)
public CharacteristicsOfACustomerAtAnApXmlDocumentWriterTests(DocumentValidationFixture documentValidation)
{
_documentValidation = documentValidation;
_systemDateTimeProvider = new SystemDateTimeProvider();
_messageRecordParser = new MessageRecordParser(new Serializer());
_messageWriter = new CharacteristicsOfACustomerAtAnApMessageWriter(_messageRecordParser);
_documentWriter = new CharacteristicsOfACustomerAtAnApDocumentWriter(_messageRecordParser);
}

[Fact]
Expand Down Expand Up @@ -197,7 +197,7 @@ private MarketActivityRecord CreateMarketActivityRecord(MrId? firstCustomerId =

private Task<Stream> WriteDocumentAsync(MessageHeader header, params MarketActivityRecord[] marketActivityRecords)
{
return _messageWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList());
return _documentWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@

namespace Tests.Infrastructure.OutgoingMessages.ConfirmRequestChangeAccountingPointCharacteristics;

public class ConfirmRequestChangeAccountingPointCharacteristicsDocumentWriterTests
public class ConfirmRequestChangeAccountingPointCharacteristicsXmlDocumentWriterTests
{
private readonly ConfirmRequestChangeAccountingPointCharacteristicsMessageWriter _messageWriter;
private readonly ConfirmRequestChangeAccountingPointCharacteristicsXmlDocumentWriter _xmlDocumentWriter;
private readonly IMessageRecordParser _messageRecordParser;
private ISchemaProvider? _schemaProvider;

public ConfirmRequestChangeAccountingPointCharacteristicsDocumentWriterTests()
public ConfirmRequestChangeAccountingPointCharacteristicsXmlDocumentWriterTests()
{
_messageRecordParser = new MessageRecordParser(new Serializer());
_messageWriter = new ConfirmRequestChangeAccountingPointCharacteristicsMessageWriter(_messageRecordParser);
_xmlDocumentWriter = new ConfirmRequestChangeAccountingPointCharacteristicsXmlDocumentWriter(_messageRecordParser);
}

[Fact]
Expand All @@ -54,7 +54,7 @@ public async Task Document_is_valid()
new(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), "FakeMarketEvaluationPointId"),
new(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), "FakeMarketEvaluationPointId"),
};
var message = await _messageWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList()).ConfigureAwait(false);
var message = await _xmlDocumentWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList()).ConfigureAwait(false);
await AssertMessage(message, header, marketActivityRecords).ConfigureAwait(false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@

namespace Tests.Infrastructure.OutgoingMessages.ConfirmRequestChangeOfSupplier
{
public class ConfirmRequestChangeOfSupplierDocumentWriterTests
public class ConfirmRequestChangeOfSupplierXmlDocumentWriterTests
{
private readonly ConfirmChangeOfSupplierXmlMessageWriter _xmlMessageWriter;
private readonly ConfirmChangeOfSupplierXmlDocumentWriter _xmlDocumentWriter;
private readonly IMessageRecordParser _messageRecordParser;
private ISchemaProvider? _schemaProvider;

public ConfirmRequestChangeOfSupplierDocumentWriterTests()
public ConfirmRequestChangeOfSupplierXmlDocumentWriterTests()
{
_messageRecordParser = new MessageRecordParser(new Serializer());
_xmlMessageWriter = new ConfirmChangeOfSupplierXmlMessageWriter(_messageRecordParser);
_xmlDocumentWriter = new ConfirmChangeOfSupplierXmlDocumentWriter(_messageRecordParser);
}

[Fact]
Expand All @@ -58,7 +58,7 @@ public async Task Document_is_valid()
new(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), "FakeMarketEvaluationPointId"),
};

var message = await _xmlMessageWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList()).ConfigureAwait(false);
var message = await _xmlDocumentWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList()).ConfigureAwait(false);

await AssertMessage(message, header, marketActivityRecords).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@

namespace Tests.Infrastructure.OutgoingMessages.GenericNotification
{
public class GenericNotificationDocumentWriterTests
public class GenericNotificationXmlDocumentWriterTests
{
private readonly GenericNotificationMessageWriter _messageWriter;
private readonly GenericNotificationXmlDocumentWriter _xmlDocumentWriter;
private readonly ISystemDateTimeProvider _systemDateTimeProvider;
private readonly IMessageRecordParser _messageRecordParser;
private ISchemaProvider? _schemaProvider;

public GenericNotificationDocumentWriterTests()
public GenericNotificationXmlDocumentWriterTests()
{
_systemDateTimeProvider = new SystemDateTimeProvider();
_messageRecordParser = new MessageRecordParser(new Serializer());
_messageWriter = new GenericNotificationMessageWriter(_messageRecordParser);
_xmlDocumentWriter = new GenericNotificationXmlDocumentWriter(_messageRecordParser);
}

[Fact]
Expand All @@ -60,7 +60,7 @@ public async Task Document_is_valid()
new(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), "FakeMarketEvaluationPointId", _systemDateTimeProvider.Now()),
};

var message = await _messageWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList()).ConfigureAwait(false);
var message = await _xmlDocumentWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList()).ConfigureAwait(false);

await AssertMessage(message, header, marketActivityRecords).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@

namespace Tests.Infrastructure.OutgoingMessages.NotifyAggreagtedMeasureData;

public class NotifyAggregatedMeasureDataDocumentWriterTests : IClassFixture<DocumentValidationFixture>
public class NotifyAggregatedMeasureDataXmlDocumentWriterTests : IClassFixture<DocumentValidationFixture>
{
private const string NamespacePrefix = "cim";
private readonly DocumentValidationFixture _documentValidation;
private readonly IMessageWriter _messageWriter;
private readonly IMessageRecordParser _parser;
private readonly TimeSeriesBuilder _timeSeries;

public NotifyAggregatedMeasureDataDocumentWriterTests(DocumentValidationFixture documentValidation)
public NotifyAggregatedMeasureDataXmlDocumentWriterTests(DocumentValidationFixture documentValidation)
{
_documentValidation = documentValidation;
_parser = new MessageRecordParser(new Serializer());
_messageWriter = new NotifyAggregatedMeasureDataMessageWriter(_parser);
_messageWriter = new NotifyAggregatedMeasureDataXmlDocumentWriter(_parser);
_timeSeries = TimeSeriesBuilder
.AggregationResult();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@

namespace Tests.Infrastructure.OutgoingMessages.RejectRequestChangeAccountingPointCharacteristics;

public class RejectRequestChangeAccountingPointCharacteristicsDocumentWriterTests
public class RejectRequestChangeAccountingPointCharacteristicsXmlDocumentWriterTests
{
private readonly RejectRequestChangeAccountingPointCharacteristicsMessageWriter _xmlMessageWriter;
private readonly RejectRequestChangeAccountingPointCharacteristicsXmlDocumentWriter _xmlXmlDocumentWriter;
private readonly IMessageRecordParser _messageRecordParser;
private ISchemaProvider? _schemaProvider;

public RejectRequestChangeAccountingPointCharacteristicsDocumentWriterTests()
public RejectRequestChangeAccountingPointCharacteristicsXmlDocumentWriterTests()
{
_messageRecordParser = new MessageRecordParser(new Serializer());
_xmlMessageWriter = new RejectRequestChangeAccountingPointCharacteristicsMessageWriter(_messageRecordParser);
_xmlXmlDocumentWriter = new RejectRequestChangeAccountingPointCharacteristicsXmlDocumentWriter(_messageRecordParser);
}

[Fact]
Expand All @@ -68,7 +68,7 @@ public async Task Document_is_valid()
}),
};

var message = await _xmlMessageWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList()).ConfigureAwait(false);
var message = await _xmlXmlDocumentWriter.WriteAsync(header, marketActivityRecords.Select(record => _messageRecordParser.From(record)).ToList()).ConfigureAwait(false);

await AssertMessage(message, header, marketActivityRecords).ConfigureAwait(false);
}
Expand Down
Loading

0 comments on commit ae55da6

Please sign in to comment.