-
-
Notifications
You must be signed in to change notification settings - Fork 13
tests #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests #59
Conversation
|
Edit: Resolved by removing the null check here: https://github.com/magiccodingman/Magic.IndexedDb/pull/59/files#diff-0132de8e88774210aad5024d05d38dc329352599e5269017d87ee2c3ce071986L76 Hmm... Have I done something wrong? It throws an exception: using Magic.IndexedDb;
using Magic.IndexedDb.Helpers;
using Microsoft.AspNetCore.Components;
using System.Text.Json;
namespace E2eTestWebApp.TestPages;
[Route("/WhereTest")]
public class WhereTestPage(IMagicDbFactory magic) : TestPageBase
{
[MagicTable("Records", null)]
private class Record
{
[MagicPrimaryKey("Id")]
public int Id { get; set; }
public int Int32Field { get; set; }
}
public async Task<string> Where1()
{
var database = await magic.OpenAsync(new DbStore()
{
Name = "Where.Where1",
Version = 1,
StoreSchemas = [SchemaHelper.GetStoreSchema(typeof(Record))]
});
await database.AddAsync<Record, int>(new Record()
{
Id = 1,
Int32Field = 1
});
await database.AddAsync<Record, int>(new Record()
{
Id = 2,
Int32Field = 2
});
await database.AddAsync<Record, int>(new Record()
{
Id = 3,
Int32Field = 3
});
var result = await database
.Where<Record>(x => x.Int32Field < 2)
.ToListAsync();
return JsonSerializer.Serialize(result.Select(x => x.Id));
}
}By the way, the steps to debug the test in visual studio:
(Note the database deletion for unit test is done in However in this case the debugger does not break at the exception... I don't why... |
|
By the way, it seems that we are regarding exceptions/errors from JavaScript as a normal result. |
No description provided.