public void QueryableUserStoreInterface_UsersPropertyGetter_ThrowsWhenDisposed() { var instance = new SecurityStore(null) as IQueryableUserStore <User, int>; instance.Dispose(); var exception = Assert.Throws <ObjectDisposedException>(() => instance.Users); exception.ShouldNotBeNull(); exception.ObjectName.ShouldEqual(instance.GetType().Name); }
public void UserClaimStoreInterface_RemoveClaimAsync_ThrowsWhenDisposed() { var instance = new SecurityStore(null) as IUserClaimStore <User, int>; instance.Dispose(); var exception = Assert.Throws <ObjectDisposedException>(() => instance.RemoveClaimAsync(null, null).GetAwaiter().GetResult()); exception.ShouldNotBeNull(); exception.ObjectName.ShouldEqual(instance.GetType().Name); }
public void UserPasswordStoreInterface_GetPasswordHashAsync_ThrowsWhenDisposed() { var instance = new SecurityStore(null) as IUserPasswordStore <User, int>; instance.Dispose(); var exception = Assert.Throws <ObjectDisposedException>(() => instance.GetPasswordHashAsync(null).Result); exception.ShouldNotBeNull(); exception.ObjectName.ShouldEqual(instance.GetType().Name); }
public void UserStoreInterface_FindByNameAsync_ThrowsWhenDisposed() { var instance = new SecurityStore(null) as IUserStore <User, int>; instance.Dispose(); var exception = Assert.Throws <ObjectDisposedException>(() => instance.FindByNameAsync(Guid.NewGuid().ToString()).Result); exception.ShouldNotBeNull(); exception.ObjectName.ShouldEqual(instance.GetType().Name); }
public void UserLoginStoreInterface_AddLoginAsync_ThrowsWhenDisposed() { var instance = new SecurityStore(null) as IUserLoginStore <User, int>; instance.Dispose(); var exception = Assert.Throws <ObjectDisposedException>(() => instance.AddLoginAsync(null, null).Wait()); exception.ShouldNotBeNull(); exception.ObjectName.ShouldEqual(instance.GetType().Name); }
public void UserLoginStoreInterface_FindAsync_ThrowsWhenDisposed() { var instance = new SecurityStore(null) as IUserLoginStore <User, int>; instance.Dispose(); var exception = Assert.Throws <ObjectDisposedException>(() => instance.FindAsync(new UserLoginInfo("provider", "key")).GetAwaiter().GetResult()); exception.ShouldNotBeNull(); exception.ObjectName.ShouldEqual(instance.GetType().Name); }
public void UserStoreInterface_FindByIdAsync_ThrowsWhenDisposed() { var instance = new SecurityStore(null) as IUserStore <User, int>; instance.Dispose(); var exception = Assert.Throws <ObjectDisposedException>(() => instance.FindByIdAsync(new Random().Next(0, int.MaxValue)).Result); exception.ShouldNotBeNull(); exception.ObjectName.ShouldEqual(instance.GetType().Name); }