public void GetViaKey() { var dataStore = new HttpApplicationStateBaseDataStoreAdapter(ApplicationStateMock.Object); Assert.Equal(5, dataStore.Get(typeof(int).AssemblyQualifiedName)); ApplicationStateMock.Verify(st => st.Get(typeof(int).AssemblyQualifiedName), Times.Once()); }
public void SetViaKey() { var dataStore = new HttpApplicationStateBaseDataStoreAdapter(ApplicationStateMock.Object); dataStore.Set("aKey", "thing"); ApplicationStateMock.Verify(st => st.Set("aKey", "thing"), Times.Once()); }
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()); }
public void GetViaGenericsWithKey() { var dataStore = new HttpApplicationStateBaseDataStoreAdapter(ApplicationStateMock.Object); var result = dataStore.Get <int>(typeof(int).AssemblyQualifiedName); Assert.Equal(5, result); Assert.IsType <int>(result); ApplicationStateMock.Verify(st => st.Get(typeof(int).AssemblyQualifiedName), Times.Once()); }
public void ConstructWithAnHttpApplicationStateBase() { var dataStore = new HttpApplicationStateBaseDataStoreAdapter(ApplicationStateMock.Object); Assert.NotNull(dataStore); }
public void NotContainItems() { var dataStore = new HttpApplicationStateBaseDataStoreAdapter(ApplicationStateMock.Object); Assert.False(dataStore.Contains("random key")); }
public void ContainItems() { var dataStore = new HttpApplicationStateBaseDataStoreAdapter(ApplicationStateMock.Object); Assert.True(dataStore.Contains(typeof(int).AssemblyQualifiedName)); }