コード例 #1
0
        public void UsingExtendedFilters()
        {
            var email = new Email
            {
                Sender      = "*****@*****.**",
                Content     = "I really like this campany !",
                Attachments = new[] { "apple.png" }
            };
            var blocker = new SpamBlocker();

            blocker.AddSpamHandler(new AttachmentHandler());
            Assert.AreEqual(true, blocker.ShouldBlock(email));
        }
コード例 #2
0
        public void UsingBaseFilters()
        {
            var email = new Email
            {
                Sender      = "*****@*****.**",
                Content     = "I really like this campany !",
                Attachments = new[] { "apple.png" }
            };
            var blocker = new SpamBlocker();

            Assert.AreEqual(false, blocker.ShouldBlock(email));

            email.Sender = "*****@*****.**";
            Assert.AreEqual(true, blocker.ShouldBlock(email));
        }