public void GetStorage_SameCollection()
        {
            IInMemoryPersistentMedium medium = new InMemoryPersistentMedium();
            var result = medium.GetStorage<string, int>();
            var result2 = medium.GetStorage<string, int>();

            Assert.IsTrue(object.ReferenceEquals(result, result2), "The two objects should be the same object.");
        }
        public void GetStorage_SameCollection_ItemsPersist()
        {
            IInMemoryPersistentMedium medium = new InMemoryPersistentMedium();
            var result = medium.GetStorage<string, int>();
            var result2 = medium.GetStorage<string, int>();

            result.Add(1);

            Assert.AreEqual(1, result2.First(), "The first item in the second collection should be what was added.");
        }
        public void ClearAll()
        {
            IInMemoryPersistentMedium medium = new InMemoryPersistentMedium();
            var result = medium.GetStorage<string, int>();
            var result2 = medium.GetStorage<string, short>();
            var result3 = medium.GetStorage<int, short>();

            result.Add(1);
            result2.Add(2);
            result3.Add(10);

            medium.ClearAll();

            Assert.AreEqual(0, result.Count(), "The collection should be empty.");
            Assert.AreEqual(0, result2.Count(), "The collection should be empty.");
            Assert.AreEqual(0, result3.Count(), "The collection should be empty.");
        }
 public void GetStorage()
 {
     IInMemoryPersistentMedium medium = new InMemoryPersistentMedium();
     var result = medium.GetStorage<string, int>();
     Assert.IsNotNull(result, "The result should never be null.");
 }