コード例 #1
0
        public void SetViaGenerics()
        {
            var dataStore = new HttpApplicationStateBaseDataStoreAdapter(ApplicationStateMock.Object);
            
            dataStore.Set<int>(5);

            Assert.Equal(5, dataStore.Get<int>());
            ApplicationStateMock.Verify(st => st.Set(typeof(int).AssemblyQualifiedName, 5), Times.Once());

        }
コード例 #2
0
        public void SetViaKey()
        {
            var dataStore = new HttpApplicationStateBaseDataStoreAdapter(ApplicationStateMock.Object);
            
            dataStore.Set("aKey", "thing");
            ApplicationStateMock.Verify(st => st.Set("aKey", "thing"), Times.Once());

        }