1{-# LANGUAGE OverloadedStrings #-}
5import qualified Data.ByteString.Char8 as C8
7import Network.API.Mandrill.Messages.Types
8import Network.API.Mandrill.Users.Types
11import Test.Tasty.HUnit
12import Text.RawString.QQ
14import qualified Network.API.Mandrill.Inbound as API
15import qualified Network.API.Mandrill.Messages as API
16import Network.API.Mandrill.Types
17import qualified Network.API.Mandrill.Users as API
22testOnlineUsersInfo :: MandrillKey -> Assertion
23testOnlineUsersInfo k = do
24 res <- API.info k Nothing
26 MandrillSuccess _ -> return ()
27 MandrillFailure e -> fail $ "users/info.json " ++ show e
29testOnlineUsersPing2 :: MandrillKey -> Assertion
30testOnlineUsersPing2 k = do
31 res <- API.ping2 k Nothing
33 MandrillSuccess _ -> return ()
34 MandrillFailure e -> fail $ "users/ping2.json " ++ show e
36testOnlineUsersSenders :: MandrillKey -> Assertion
37testOnlineUsersSenders k = do
38 res <- API.senders k Nothing
40 MandrillSuccess _ -> return ()
41 MandrillFailure e -> fail $ "users/senders.json " ++ show e
47testOnlineMessagesSend :: MandrillKey -> Assertion
48testOnlineMessagesSend k = do
49 msg <- generate arbitrary
50 res <- API.send k msg Nothing Nothing Nothing Nothing
52 MandrillSuccess _ -> return ()
53 MandrillFailure e -> fail $ "messages/send.json " ++ show e
58testOnlineDomainAdd :: MandrillKey -> Assertion
59testOnlineDomainAdd k = do
60 res <- API.addDomain k "foobar.com" Nothing
62 MandrillSuccess a -> print a
63 MandrillFailure e -> fail $ "inbound/add-domain.json " ++ show e
65testOnlineRouteAdd :: MandrillKey -> Assertion
66testOnlineRouteAdd k = do
67 res <- API.addRoute k "foobar.com" "mail-*" "http://requestb.in/19a4frw1" Nothing
69 MandrillSuccess a -> print a
70 MandrillFailure e -> fail $ "inbound/add-domain.json " ++ show e
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list