public virtual void AddWithNoSetUp_TestObject_AddInvokedOnce() { var cacheEntryKey = "SomethingInTheCache"; var expectedResult = new TestObject(); MockedCache.Set(cacheEntryKey, expectedResult); MockedCache.Received(1).CreateEntry(cacheEntryKey); }
public virtual void AddWithNoSetUp_TestObject_AddInvokedOnce() { var cacheEntryKey = "SomethingInTheCache"; var expectedResult = new TestObject(); MockedCache.Set(cacheEntryKey, expectedResult); Mock.Get(MockedCache).Verify(m => m.CreateEntry(cacheEntryKey), Times.Once); }
public virtual void AddThenGetWithNoSetUp_TestObject_GetInvokedOnce() { var cacheEntryKey = "SomethingInTheCache"; var expectedResult = new TestObject(); MockedCache.Set(cacheEntryKey, expectedResult); var actualResult = MockedCache.Get <TestObject>(cacheEntryKey); object value; MockedCache.Received(1).TryGetValue(cacheEntryKey, out value); }