public override void OnGroupMessage(object sender, GroupMessageEventArgs args) { var reply = _service.Get(args.Message.AsReadable(), args.Group.Identity); if (reply != null) { args.Group.SendAsync(reply.Reply.MakeMessageChain()).Wait(); } }
public async void Get_null_record() { var mock = new ServiceMockFacade <IReplyRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <Reply>(null)); var service = new ReplyService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.ReplyModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLReplyMapperMock, mock.DALMapperMockFactory.DALReplyMapperMock); ApiReplyResponseModel response = await service.Get(default(int)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>())); }