Beispiel #1
0
        public void TestTOPSpecificEntire()
        {
            Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "*****@*****.**", "test");

             for (int i = 1; i <= 10; i++)
            SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "TestBody" + i.ToString());

             POP3Simulator.AssertMessageCount(account.Address, "test", 10);

             var sim = new POP3Simulator();
             sim.ConnectAndLogon(account.Address, "test");
             string result = sim.TOP(1, 0);

             Assert.IsTrue(result.Contains("Received"));
             Assert.IsTrue(result.Contains("Subject"));
        }
Beispiel #2
0
        public void TestTOPSpecificPartial()
        {
            Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "*****@*****.**", "test");

             for (int i = 1; i <= 10; i++)
            SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test",
                                           "Line1\r\nLine2\r\nLine3\r\nLine4\r\nLine\r\n");

             POP3Simulator.AssertMessageCount(account.Address, "test", 10);

             var sim = new POP3Simulator();
             sim.ConnectAndLogon(account.Address, "test");
             string result = sim.TOP(4, 2);

             Assert.IsTrue(result.Contains("Received"));
             Assert.IsTrue(result.Contains("Line1"));
             Assert.IsTrue(result.Contains("Line2"));
             Assert.IsFalse(result.Contains("Line3"));
             Assert.IsFalse(result.Contains("Line4"));
        }
Beispiel #3
0
        public void TestTOPInvalid()
        {
            Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "*****@*****.**", "test");

             for (int i = 1; i <= 10; i++)
            SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "TestBody" + i.ToString());

             POP3Simulator.AssertMessageCount(account.Address, "test", 10);

             var sim = new POP3Simulator();
             sim.ConnectAndLogon(account.Address, "test");
             Assert.IsTrue(sim.TOP(-1, 0).Contains("No such message"));
             Assert.IsTrue(sim.TOP(0, 0).Contains("No such message"));
             Assert.IsTrue(sim.TOP(100, 0).Contains("No such message"));
        }