public void ClearShouldClearStore()
        {
            var cache = new ConcurrentDiscoveryCache();

            cache.Add("001", "01", new DiscoveryResponse(_responses[0]));
            cache.Add("002", "02", new DiscoveryResponse(_responses[1]));
            cache.Clear();

            Assert.IsTrue(cache.IsEmpty);
        }
        public void CacheShouldGetResponseWhenMultipleStored()
        {
            var cache    = new ConcurrentDiscoveryCache();
            var expected = new DiscoveryResponse(_responses[1]);
            var mcc      = "001";
            var mnc      = "01";

            cache.Add(mcc, mnc, expected);
            cache.Add("002", "02", new DiscoveryResponse(_responses[0]));
            var actual = cache.Get(mcc, mnc).Result;

            Assert.IsNotNull(actual);
            Assert.IsTrue(actual.Cached);
            Assert.IsNotNull(actual.ResponseData.response.apis);
        }
        public void CacheShouldNotAddWithEmptyOrNullArguments(string mcc, string mnc)
        {
            var cache = new ConcurrentDiscoveryCache();

            cache.Add(mcc, mnc, new DiscoveryResponse(_responses[0]));

            Assert.IsTrue(cache.IsEmpty);
        }
        public void RemoveShouldRemoveStoredResponse()
        {
            var cache = new ConcurrentDiscoveryCache();
            var mcc   = "001";
            var mnc   = "01";

            cache.Add(mcc, mnc, new DiscoveryResponse(_responses[0]));
            cache.Remove(mcc, mnc);
            var actual = cache.Get(mcc, mnc).Result;

            Assert.IsNull(actual);
        }
        public void AddShouldStoreDiscoveryResponse()
        {
            var cache    = new ConcurrentDiscoveryCache();
            var response = new DiscoveryResponse(_responses[0]);
            var mcc      = "001";
            var mnc      = "01";

            cache.Add(mcc, mnc, response);
            var actual = cache.Get(mcc, mnc).Result;

            Assert.IsFalse(cache.IsEmpty);
            Assert.IsNotNull(actual);
            Assert.IsTrue(actual.Cached);
            Assert.AreEqual(response.ResponseData.response, actual.ResponseData.response);
        }