public void DeserializeFromXml() { var xml = $"<{nameof(ServiceContractProtectionBehaviorExtension).ToCamelCase()} protectionLevel=\"EncryptAndSign\" />"; var sut = new ServiceContractProtectionBehaviorExtensionSpy(); sut.DeserializeFromXml(xml); sut.ProtectionLevel.Should().Be(ProtectionLevel.EncryptAndSign); }
public void SerializeToXml() { var xml = $"<{nameof(ServiceContractProtectionBehaviorExtension).ToCamelCase()} protectionLevel=\"Sign\" />"; var sut = new ServiceContractProtectionBehaviorExtensionSpy { ProtectionLevel = ProtectionLevel.Sign }; XDocument.Parse(sut.SerializeToXml()).Should().BeEquivalentTo(XDocument.Parse(xml)); }