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()); POP3ClientSimulator.AssertMessageCount(account.Address, "test", 10); var sim = new POP3ClientSimulator(); sim.ConnectAndLogon(account.Address, "test"); string result = sim.TOP(1, 0); CustomAssert.IsTrue(result.Contains("Received")); CustomAssert.IsTrue(result.Contains("Subject")); }
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"); POP3ClientSimulator.AssertMessageCount(account.Address, "test", 10); var sim = new POP3ClientSimulator(); sim.ConnectAndLogon(account.Address, "test"); string result = sim.TOP(4, 2); CustomAssert.IsTrue(result.Contains("Received")); CustomAssert.IsTrue(result.Contains("Line1")); CustomAssert.IsTrue(result.Contains("Line2")); CustomAssert.IsFalse(result.Contains("Line3")); CustomAssert.IsFalse(result.Contains("Line4")); }
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()); POP3ClientSimulator.AssertMessageCount(account.Address, "test", 10); var sim = new POP3ClientSimulator(); sim.ConnectAndLogon(account.Address, "test"); CustomAssert.IsTrue(sim.TOP(-1, 0).Contains("No such message")); CustomAssert.IsTrue(sim.TOP(0, 0).Contains("No such message")); CustomAssert.IsTrue(sim.TOP(100, 0).Contains("No such message")); }