Exemplo n.º 1
0
        public void ParsesEmptyQueryString()
        {
            // Arrange
            OcrClient client = new OcrClient(API_KEY, REGION);

            // Act
            string parsedString = client.ParseQueryString();

            // Assert
            Assert.NotNull(parsedString);
            Assert.Equal(string.Empty, parsedString);
        }
Exemplo n.º 2
0
        public void ParsesQueryString()
        {
            // Arrange
            Dictionary <string, string> parameters = new Dictionary <string, string>
            {
                { "parameter1", "parameter1value" },
                { "parameter2", "Parameter2ValueWithCapitals" },
                { "parameter3", "parameter3valuewithspecialcharacters@&#šνα" }
            };

            OcrClient client = new OcrClient(API_KEY, REGION);

            foreach (var parameter in parameters)
            {
                client.QueryStringValues.Add(parameter.Key, parameter.Value);
            }

            // Act
            string parsedString = client.ParseQueryString();

            // Assert
            Assert.NotNull(parsedString);
            Assert.Equal("?parameter1=parameter1value&parameter2=Parameter2ValueWithCapitals&parameter3=parameter3valuewithspecialcharacters%40%26%23%C5%A1%C3%AD%C3%A1", parsedString);
        }