public async Task FindByName() { using (var store = new UserStoreFixture <ElasticUser>()) { var user = new ElasticUser(UserId, UserName) { Email = new ElasticUserEmail { Address = "*****@*****.**", IsConfirmed = false } }; await store.CreateAsync(user); var elasticUser = await store.FindByNameAsync(UserName); Assert.NotNull(elasticUser); Assert.Equal(user.UserName, elasticUser.UserName); // should ignore case elasticUser = await store.FindByNameAsync(UserName.ToUpper()); Assert.NotNull(elasticUser); Assert.Equal(user.UserName, elasticUser.UserName); } }
public async Task CreateUserWithElasticId() { using (var store = new UserStoreFixture <ElasticUser>()) { var user = new ElasticUser() { UserName = UserName, Phone = new ElasticUserPhone { Number = "555 123 1234", IsConfirmed = true }, Email = new ElasticUserEmail { Address = "*****@*****.**", IsConfirmed = false } }; await store.CreateAsync(user); var elasticUser = await store.FindByNameAsync(UserName); Assert.NotNull(elasticUser); Assert.Equal(elasticUser.UserName, UserName); Assert.NotNull(elasticUser.Id); Assert.NotEqual(UserId, elasticUser.Id); Assert.NotNull(elasticUser.Version); } }
public async Task DeleteUser() { using (var store = new UserStoreFixture <ElasticUser>()) { var user = new ElasticUser(UserId, UserName); await store.CreateAsync(user); await store.DeleteAsync(user); var elasticUser = await store.FindByNameAsync(user.UserName); Assert.Null(elasticUser); } }