public void Constructor_PassNullKeyPropertyName_ThrowsException()
        {
            //Arrange
            string keyPropertyName = null;

            //Act
            var result = new ReadOnlyPicnicCache <int, ITestObject>(keyPropertyName, _mockCacheable.Object);
        }
        public void Constructor_PassValidKeyPropertyName_FetchWorks()
        {
            //Arrange
            var cache = new ReadOnlyPicnicCache <int, ITestObject>("Id", _mockCacheable.Object);
            var item  = GetTestList(1).First();

            _mockCacheable.Setup(c => c.Fetch(1)).Returns(item);

            //Act
            var result = cache.Fetch(1);

            //Assert
            Assert.AreEqual(item, result);
        }
 public void Constructor_PassNullCacheable_ThrowsException()
 {
     //Act
     var result = new ReadOnlyPicnicCache <int, ITestObject>("Id", null);
 }
 public void Constructor_PassInvalidKeyPropertyName_ThrowsException()
 {
     //Act
     var result = new ReadOnlyPicnicCache <int, ITestObject>("Test", _mockCacheable.Object);
 }