예제 #1
0
        private StorsdagInviter CreateInviter()
        {
            var inviteLogger = A.Fake <ILogger <StorsdagInviter> >();
            var client       = A.Fake <ISlackClient>();

            A.CallTo(() => client.UsersList()).Returns(new UsersListResponse {
                Ok      = true,
                Members = new []
                {
                    new User
                    {
                        Id   = "U0EBWMGG4",
                        Name = "johnkors"
                    }
                }
            });
            A.CallTo(() => client.ChatPostMessage(A <ChatPostMessageRequest> ._)).Returns(new ChatPostMessageResponse()
            {
                Ok = true
            });
            var questioner         = new SlackQuestionClient(client);
            var eventsStorage      = A.Fake <IEventsStorage>();
            var invitationsStorage = A.Fake <IInvitationsStorage>();

            return(new StorsdagInviter(eventsStorage, invitationsStorage, client, questioner, inviteLogger));
        }
예제 #2
0
 public StorsdagInviter(IEventsStorage eventStorage, IInvitationsStorage inviteStorage, ISlackClient slackClient, SlackQuestionClient questioner, ILogger <StorsdagInviter> logger)
 {
     _eventStorage  = eventStorage;
     _inviteStorage = inviteStorage;
     _slackClient   = slackClient;
     _questioner    = questioner;
     _logger        = logger;
 }