public async Task CanReadExternalPartyRequestByOrderIdAndRequestId() { string orderId = "2"; Guid requestId = Guid.NewGuid(); using (var addingContext = new BudgetDataDbContext(DbContextOptions)) { addingContext.ExternalPartyRequest.Add(new ExternalPartyRequest( orderId, request: "{}") { Operation = WarrantyCaseOperation.Verify, RequestId = requestId }); await addingContext.SaveChangesAsync(); } using (var readingContext = new BudgetDataDbContext(DbContextOptions)) { var actual = await readingContext.ExternalPartyRequest .Where(req => req.OrderId == orderId) .Where(req => req.RequestId == requestId) .FirstOrDefaultAsync(); Assert.Equal(orderId, actual.OrderId); Assert.Equal(requestId, actual.RequestId); Assert.Equal(WarrantyCaseOperation.Verify, actual.Operation); Assert.Equal(DateTimeKind.Utc, actual.DateTime.Kind); } }
public async Task CanAddExternalPartyResponse() { using var context = new BudgetDataDbContext(DbContextOptions); context.ExternalPartyResponse.Add(new ExternalPartyResponse( orderId: "1", response: "{}") { Operation = WarrantyCaseOperation.Create, RequestId = Guid.NewGuid() }); await context.SaveChangesAsync(); }