public async Task TestCrudOperationsAsync() { // Create one userPreferences UserPreferencesV1 userPreferences1 = await _persistence.SetAsync(null, USER_PREFERENCES1); Assert.NotNull(userPreferences1); Assert.Equal(USER_PREFERENCES1.Id, userPreferences1.Id); Assert.Equal(USER_PREFERENCES1.UserId, userPreferences1.UserId); // Create another userPreferences UserPreferencesV1 userPreferences2 = await _persistence.SetAsync(null, USER_PREFERENCES2); Assert.NotNull(userPreferences2); Assert.Equal(USER_PREFERENCES2.Id, userPreferences2.Id); Assert.Equal(USER_PREFERENCES2.UserId, userPreferences2.UserId); // Get all userPreferencess DataPage <UserPreferencesV1> page = await _persistence.GetPageByFilterAsync(null, null, null); Assert.NotNull(page); Assert.NotNull(page.Data); Assert.Equal(2, page.Data.Count); // Update the userPreferences userPreferences1.UserId = "3"; UserPreferencesV1 userPreferences = await _persistence.SetAsync( null, userPreferences1 ); Assert.NotNull(userPreferences); Assert.Equal(userPreferences1.Id, userPreferences.Id); Assert.Equal("3", userPreferences.UserId); // Delete the userPreferences userPreferences = await _persistence.ClearByIdAsync(null, userPreferences1.UserId); Assert.Null(userPreferences.Theme); }