예제 #1
0
        public void CreateUsersInChannelRequestThrowsOnNullArguments()
        {
            var requestFactory = new RequestFactory("apiKey", "secretKey", "http://example.com");

            Assert.Throws<ArgumentNullException>(() => requestFactory.CreateUsersInChannelRequest(null));
            Assert.Throws<ArgumentNullException>(() => requestFactory.CreateUsersInChannelRequest(string.Empty));
        }
예제 #2
0
        public void CreateUsersInChannelRequestReturnsCorrectRequest()
        {
            var baseUrl = "http://example.com";
            var apiKey = "apiKey";
            var secretKey = "secretKey";
            var requestFactory = new RequestFactory(apiKey, secretKey, baseUrl);

            var request = requestFactory.CreateUsersInChannelRequest("name");

            request.AssertCorrectSecret(secretKey);
            request.AssertCorrectContentType();
            request.AssertCorrectMethod(HttpVerb.GET);
            request.AssertCorrectUrl(baseUrl, apiKey, "channels/name");
            Assert.That(string.IsNullOrEmpty(request.Body));
        }