Commit graph

22 commits

Author SHA1 Message Date
Sipke Schoorstra cea453cb4f Fix unit tests 2021-09-16 20:34:32 +02:00
Sipke Schoorstra 37d687d526 Update names according to convention 2021-09-16 20:26:18 +02:00
Sipke Schoorstra 42e95033cf
BREAKING: Persistable input (#1302)
* Implement resuming Idle workflows + persistable input

* Refactor workflow input model

* Re-enable tests
2021-07-22 22:13:33 +02:00
Sipke Schoorstra f67140f7e2 Cleanup 2021-06-14 14:10:03 +02:00
Sipke Schoorstra 0c79bac321 Updated some namespaces 2021-06-14 14:10:03 +02:00
Sipke Schoorstra 400a862f96 Cleanup: remove unused namespaces 2021-05-13 11:31:38 +02:00
Sipke Schoorstra 173ded683f Provide Id value to mocked ActivityBlueprint 2021-05-05 13:14:28 +02:00
Sipke Schoorstra ce957b95e7 Cleanup 2021-04-07 13:13:13 +02:00
Craig Fowler 282c90f80f Further fixup & refactoring of Autofixture attribs
This now also includes reworking the attribute which activates
Autofixture-style resolution upon an IServiceProvider.
This has now been renamed to WithAutofixtureResolutionAttribute.

The new/reworked attribute is composable with other Autofixture
attributes.
2021-04-02 13:28:27 +01:00
Craig Fowler f2b27480fc Trivial - remove redundant types 2021-04-02 12:08:05 +01:00
Craig Fowler 088cf7fdf6 Merge remote-tracking branch 'elsa-core/feature/elsa-2.0' into 751-postgres-yessql-exception 2021-04-02 11:14:16 +01:00
Craig Fowler d285b8b505 WIP composing customize attributes
This isn't really related to #751 - it's a refactor of some of
our test logic, to avoid bloat of semi-repeated autofixture
customization attributes.

By switching to a behaviour-driven model, it's possible to
compose them, which means that there's no need to part-duplicate
between them.  It should also reduce the overall number of them,
as combinations can be put together on-demand, rather than needing
a new attribute of their own.
2021-04-02 11:12:21 +01:00
Craig Fowler 0eaa11e69d Trivial - correct a typo in class naming 2021-04-01 20:25:09 +02:00
Craig Fowler 8e16f5f269 Related to #761 - Refactor complex conversion
This removes all of the (now actually non-trivial) conversion logic from
the class which is actually responsible for executing the Jint engine.
This moves it all to a new service which uses chain of responsibility to
convert the result, using one of a few different mechanisms.

Of note is the handling of ExpandoObject when no specific type
information has been provided, and also the handling of enumerables,
with the exception of strings.
2021-04-01 20:25:09 +02:00
Craig Fowler dd9c1f5cdc WIP #761 - Unit test indicates location of problem
This unit test narrows the problem down to the class
JavaScriptService.
2021-04-01 20:25:09 +02:00
Craig Fowler ef117eced7 Trivial - correct a typo in class naming
This is a cherry-pick to get the same fix into this branch.
2021-04-01 19:04:28 +01:00
Craig Fowler 1dee17b904 WIP #738 - Add test coverage for new service
This test passes, but as you can see it's
massive because of the complexity of what the
class has to do.
2021-03-18 18:54:23 +00:00
Sipke Schoorstra 0c15c94ea7
Telnyx Activities (#768)
* Fix liquid syntax for accessing activity output

* Initial scaffolding of Telnyx module + API changes

* Make Telnyx Notification activity blocking

* Implement Telnyx correlation

* Post workflow suspension tasks improvements

* Add Telnyx activities

* Add HangupCall and TransferCall activities

* Call activity improvements
2021-03-17 13:07:14 +01:00
Craig Fowler 4873aac316 Resolve #748 - Test coverage for EF Db Contexts
As well as providing a unit test which matches other persistence
provider tests (round-tripping a workflow instance), two other tests
are included here:

* When using the default DI registration extension method, this sets
  up pooling of DB contexts and so a resolved context will come from
  the pool.

* When using the non-pooled DI registration extension method, this
  sets up EF without pooling, which is more useful in a multi-tenanted
  environment.

There are also some other changes in this commit corresponding to
improving the tests.  Mainly de-duplicating logic & improving names.
2021-03-13 15:21:44 +00:00
Craig Fowler cbc7c2d461 WIP #552 - Refactor test logic (reusability)
This refactor of integration test logic is to boost its
reusability.  Moving some functionality to attributes &
customization classes means I can reuse elsewhere without
duplication.
2021-03-06 13:55:19 +00:00
Craig Fowler b583c7f1a9
Resolves #485 - Add PurgeVariables functionality (#654)
* Trivial - Add VS Code workspace

* Trivial - Add VSCode build task & extra ignore

On GNU/Linux, auto-generated .directory
files should be ignored.

* WIP #485 - Boilerplate for unit test project

* WIP #485 - Add test coverage (Remove/RemoveAll)

* WIP #485 - Implement RemoveAll

* Remove redundant logic, covered by IDictionary

Per the following, the contract for a generic IDictionary,
the Remove method already deals with non-existent keys.

  https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.idictionary-2.remove?view=net-5.0#System_Collections_Generic_IDictionary_2_Remove__0_

* Resolve #485 - Add PurgeVariables methods

These are convenience methods upon ActivityExecutionContext
and WorkflowExecutionContext, consistent with their current APIs.

Also in this commit are tests for those simple methods.
There's a bit of test-scaffold as well included, such as:
* Autofixture Xunit2 integration
* New project for unit tests
* Customize attribute for avoiding crashes on Autofixture recursion
* Reusable specimen builder for creating IServiceProvider which
  resolves services from Autofixture
* Custonize attribute for a parameter to use that ^^ specimen builder
2021-02-24 14:29:03 +01:00
Sipke Schoorstra bd3b41440a Incremental work on tests and QA 2020-10-19 22:12:11 +02:00