【发布时间】:2011-10-29 02:48:47
【问题描述】:
我真的是 C# 的新手,我正在尝试对使用 Amazon SES 发送电子邮件的某些代码的测试进行故障排除。
[TestMethod()]
public void SendEmailTest()
{
SESEmailProvider target = new SESEmailProvider();
string ToEmailAddresses = "someone@gmail.com";
string FromEmailAddress = "no-reply@mydomain.com";
string Subject = "Test";
string EmailBody = "Hello world.";
string expected = string.Empty;
string actual;
actual = target.SendEmail(ToEmailAddresses, FromEmailAddress, Subject, EmailBody);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
Visual Studio 中的错误信息是:
string SESEmailProvider.SendEmail(
System.Collections.Generic.List<string> ToEmailAddresses,
string FromEmailAddress, string Subject, string EmailBody)
Error:
The best overloaded method match for 'MyServices.SESEmailProvider.SendEmail(
System.Collections.Generic.List<string>, string, string, string)'
has some invalid arguements.
我认为问题在于它期望 ToEmailAddresses 是一个列表,而不是单个字符串,但我正在努力寻找一种转换/处理它的方法。
谢谢!
【问题讨论】:
标签: c# string asp.net-mvc-3 list