コード例 #1
0
        public void ChannelWrapper_RandomizesGivenUrl()
        {
            var originalUrl = "tcpex://localhost:12356/CoolService";
            var randomized1 = ChannelWrapper.RandomizeUrl(originalUrl);
            var randomized2 = ChannelWrapper.RandomizeUrl(originalUrl);

            Assert.IsFalse(string.IsNullOrWhiteSpace(randomized1));
            Assert.IsFalse(string.IsNullOrWhiteSpace(randomized2));

            Assert.AreNotEqual(originalUrl, randomized1);
            Assert.AreNotEqual(originalUrl, randomized2);
            Assert.AreNotEqual(randomized1, randomized2);

            Assert.IsTrue(randomized1.EndsWith(originalUrl));
            Assert.IsTrue(randomized2.EndsWith(originalUrl));
        }