Exemple #1
0
        public void CacheStore_MultipleUris_StoresAll()
        {
            // Arrange

            var servers = new List <Uri>
            {
                Uri1,
                Uri2
            };

            var provider = new DefaultVersionProvider();

            // Act

            provider.CacheStore(servers, Version45);

            // Assert

            var result = provider.CacheLookup(servers.Take(1));

            Assert.AreEqual(Version45, result);

            result = provider.CacheLookup(servers.Skip(1));
            Assert.AreEqual(Version45, result);
        }
Exemple #2
0
        public void CacheLookup_MultipleUrisOneInCache_ReturnsVersion()
        {
            // Arrange

            var servers1 = new List <Uri>
            {
                Uri1
            };

            var servers2 = new List <Uri>
            {
                Uri2
            };

            var provider = new DefaultVersionProvider();

            provider.CacheStore(servers2, Version45);

            // Act

            var result = provider.CacheLookup(servers1.Concat(servers2));

            // Assert

            Assert.AreEqual(Version45, result);
        }
        public void CacheLookup_EmptyCache_ReturnsNull()
        {
            // Arrange

            var servers = new Mock <ICluster>();

            var provider = new DefaultVersionProvider();

            // Act

            var result = provider.CacheLookup(servers.Object);

            // Assert

            Assert.IsNull(result);
        }
        public void CacheLookup_IsInCache_ReturnsVersion()
        {
            // Arrange

            var cluster = new Mock <ICluster>();

            var provider = new DefaultVersionProvider();

            provider.CacheStore(cluster.Object, Version45);

            // Act

            var result = provider.CacheLookup(cluster.Object);

            // Assert

            Assert.AreEqual(Version45, result);
        }
Exemple #5
0
        public void CacheLookup_EmptyCache_ReturnsNull()
        {
            // Arrange

            var servers = new List <Uri>
            {
                Uri1
            };

            var provider = new DefaultVersionProvider();

            // Act

            var result = provider.CacheLookup(servers);

            // Assert

            Assert.IsNull(result);
        }
        public void CacheLookup_EmptyCache_ReturnsNull()
        {
            // Arrange

            var servers = new List<Uri>
            {
                Uri1
            };

            var provider = new DefaultVersionProvider();

            // Act

            var result = provider.CacheLookup(servers);

            // Assert

            Assert.IsNull(result);
        }
Exemple #7
0
        public void CacheLookup_IsInCache_ReturnsVersion()
        {
            // Arrange

            var servers = new List <Uri>
            {
                Uri1
            };

            var provider = new DefaultVersionProvider();

            provider.CacheStore(servers, Version45);

            // Act

            var result = provider.CacheLookup(servers);

            // Assert

            Assert.AreEqual(Version45, result);
        }
        public void CacheLookup_IsInCache_ReturnsVersion()
        {
            // Arrange

            var servers = new List<Uri>
            {
                Uri1
            };

            var provider = new DefaultVersionProvider();

            provider.CacheStore(servers, Version45);

            // Act

            var result = provider.CacheLookup(servers);

            // Assert

            Assert.AreEqual(Version45, result);
        }
        public void CacheLookup_MultipleUrisOneInCache_ReturnsVersion()
        {
            // Arrange

            var servers1 = new List<Uri>
            {
                Uri1
            };

            var servers2 = new List<Uri>
            {
                Uri2
            };

            var provider = new DefaultVersionProvider();

            provider.CacheStore(servers2, Version45);

            // Act

            var result = provider.CacheLookup(servers1.Concat(servers2));

            // Assert

            Assert.AreEqual(Version45, result);
        }
        public void CacheStore_MultipleUris_StoresAll()
        {
            // Arrange

            var servers = new List<Uri>
            {
                Uri1,
                Uri2
            };

            var provider = new DefaultVersionProvider();

            // Act

            provider.CacheStore(servers, Version45);

            // Assert

            var result = provider.CacheLookup(servers.Take(1));
            Assert.AreEqual(Version45, result);

            result = provider.CacheLookup(servers.Skip(1));
            Assert.AreEqual(Version45, result);
        }