Пример #1
0
        public void InvalidUrl()
        {
            BitlyService service           = new BitlyService();
            Regex        lowerLengthRegex  = new Regex(@"^[A-Za-z]{8:}$");
            Regex        higherLengthRegex = new Regex(@"^[A-Za-z]{0:7}$");

            Boolean lowerMatch  = lowerLengthRegex.IsMatch(service.GetRandomUrlEndpoint());
            Boolean higherMatch = higherLengthRegex.IsMatch(service.GetRandomUrlEndpoint());

            Assert.False(lowerMatch);
            Assert.False(higherMatch);
        }
Пример #2
0
        public void CreateRandomUrl()
        {
            BitlyService service = new BitlyService();
            Regex        regex   = new Regex(@"^[A-Za-z]{8}$");
            Boolean      match   = regex.IsMatch(service.GetRandomUrlEndpoint());

            Assert.True(match);
        }