From 10d33f352bc3bb7ee84e5b130e625da2ffe49841 Mon Sep 17 00:00:00 2001 From: mark van tilburg Date: Tue, 1 Oct 2024 10:30:26 +0200 Subject: [PATCH] Update SpfTests.cs Add unit test for the Multiple Spf Record fail _SpfInvalidException_ --- BusinessMonitor.MailTools.Test/SpfTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/BusinessMonitor.MailTools.Test/SpfTests.cs b/BusinessMonitor.MailTools.Test/SpfTests.cs index ced726f..32bad1b 100644 --- a/BusinessMonitor.MailTools.Test/SpfTests.cs +++ b/BusinessMonitor.MailTools.Test/SpfTests.cs @@ -146,6 +146,21 @@ public void TestInvalidArguments() }); } + [Test] + public void TestMultipleSPFRecords() + { + DummyResolver resolver = new DummyResolver(); + var check = new SpfCheck(resolver); + + resolver.AddText("x.businessmonitor.nl", "v=spf1 include:survey.businessmonitor.nl -all"); + resolver.AddText("x.businessmonitor.nl", "v=spf1 ip4:192.0.2.1 -all"); + + Assert.Throws(() => + { + check.GetSpfRecord("x.businessmonitor.nl"); + }); + } + [Test] public void TestWhitespaces() {