public void TlsRptRecordWitInvalidRuaTagLessThan11CharactersToken()
        {
            string    ruaEmail     = "*****@*****.**";
            string    tlsRptRecord = $"v=TLSRPTv1;rua=mailto:{ruaEmail};";
            RuaResult result       = _ruaValidator.Validate(tlsRptRecord);

            Assert.That(result.Valid, Is.False);
            Assert.That(result.Tokens.Count, Is.EqualTo(0));
        }
        public void TlsRptRecordWithInvalidRuaTag()
        {
            string    ruaEmail     = "*****@*****.**";
            string    tlsRptRecord = $"v=TLSRPTv1;rua=mailto:{ruaEmail},mailto:{ruaEmail};";
            RuaResult result       = _ruaValidator.Validate(tlsRptRecord);

            Assert.That(result.Valid, Is.False);
            Assert.That(result.Tokens.Count, Is.EqualTo(0));
        }
        public void TlsRptRecordWithOneValidRuaTag()
        {
            string    ruaEmail     = "*****@*****.**";
            string    tlsRptRecord = $"v=TLSRPTv1;rua=mailto:{ruaEmail};";
            RuaResult result       = _ruaValidator.Validate(tlsRptRecord);

            Assert.That(result.Valid, Is.True);
            Assert.That(result.Tokens.Count, Is.EqualTo(1));
            Assert.That(result.Tokens[0], Is.EqualTo("test1234567"));
        }
        public void Process(string id, string record)
        {
            RuaResult result = _ruaValidator.Validate(record);

            if (result.Valid)
            {
                result.Tokens.ForEach(x => _dispatcher.Dispatch(new RuaVerificationChangeFound(id, "TlsRpt", x),
                                                                _tlsRptEntityHistoryConfig.SnsTopicArn));

                _log.LogInformation("Published Rua found for {Id}", id);
            }
            else
            {
                _log.LogInformation("Invalid Rua found for {Id}", id);
            }
        }