private SendingProcessingMode ExerciseDecorate(SendingProcessingMode pmode, SmpConfiguration smpResponse) { var doc = new XmlDocument(); doc.LoadXml(AS4XmlSerializer.ToString(smpResponse)); var sut = new LocalDynamicDiscoveryProfile(GetDataStoreContext); return(sut.DecoratePModeWithSmpMetaData(pmode, doc).CompletedSendingPMode); }
public void DecorateMandatoryInfoToSendingPMode() { // Arrange var smpResponse = new SmpConfiguration { PartyRole = "role", Url = "http://some/url" }; var doc = new XmlDocument(); doc.LoadXml(AS4XmlSerializer.ToString(smpResponse)); var pmode = new SendingProcessingMode(); var sut = new LocalDynamicDiscoveryProfile(GetDataStoreContext); // Act SendingProcessingMode actual = sut.DecoratePModeWithSmpMetaData(pmode, doc).CompletedSendingPMode; // Assert Assert.Equal(smpResponse.Url, actual.PushConfiguration.Protocol.Url); }
public async Task RetrieveSmpResponseFromDatastore() { // Arrange var fixture = new Party("role", new PartyId(Guid.NewGuid().ToString(), "type")); var expected = new SmpConfiguration { PartyRole = fixture.Role, ToPartyId = fixture.PrimaryPartyId, PartyType = "type" }; InsertSmpResponse(expected); var sut = new LocalDynamicDiscoveryProfile(GetDataStoreContext); // Act XmlDocument actualDoc = await sut.RetrieveSmpMetaDataAsync(fixture, properties : null); // Assert var actual = AS4XmlSerializer.FromString <SmpConfiguration>(actualDoc.OuterXml); Assert.Equal(expected.ToPartyId, actual.ToPartyId); }