Пример #1
0
        private AblyRealtime GetNotModifiedClient()
        {
            var options = new AblyRealtimeOptions()
            {
                Key = ApiKey, UseBinaryProtocol = false
            };
            var client = new AblyRealtime(options);

            client.InitAuth(new Rest.AblySimpleRestClient(options));

            Config.Now = () => Now;
            return(client);
        }
Пример #2
0
        private AblyRealtime GetClient(Func <AblyRequest, AblyResponse> executeHttpRequest)
        {
            var options = new AblyRealtimeOptions()
            {
                Key = ApiKey, UseBinaryProtocol = false
            };
            var client         = new AblyRealtime(options);
            var httpClientMock = new Moq.Mock <IAblyHttpClient>();

            httpClientMock.Setup(c => c.Execute(Moq.It.IsAny <AblyRequest>())).Returns(executeHttpRequest);

            client.InitAuth(new Rest.AblySimpleRestClient(options, httpClientMock.Object));

            Config.Now = () => Now;
            return(client);
        }