コード例 #1
0
 public MessageBusMailingList(MailingListItem item)
 {
     MailingListKey = item.mailingListKey;
     Name = item.name;
     MergeFieldKeys = item.mergeFields;
     ValidCount = item.validCount;
     InvalidCount = item.invalidCount;
 }
コード例 #2
0
 public void ListMailingListsTest()
 {
     var result = new MailingListItem() {
         mailingListKey = "TEST",
         name = "hello",
         mergeFields = new[] { "%EMAIL%", "%NAME%" },
         validCount = 2,
         invalidCount = 1
     };
     MockHttpClient.Expect(
         x =>
         x.ListMailingLists())
         .Return(new MailingListsResponse() {
             statusCode = 200,
             results = new List<MailingListItem> {
                 result
             }
         });
     var actual = MailingListClient.ListMailingLists();
     Assert.AreEqual("hello", actual[0].Name);
     Assert.AreEqual("TEST", actual[0].MailingListKey);
     Assert.AreEqual("%EMAIL%", actual[0].MergeFieldKeys[0]);
     Assert.AreEqual("%NAME%", actual[0].MergeFieldKeys[1]);
     Assert.AreEqual(2, actual[0].ValidCount);
     Assert.AreEqual(1, actual[0].InvalidCount);
 }