feat(mosstank): add VTank-style automation PoC
This commit is contained in:
parent
f6fe0f2a4f
commit
4e6e9bc9d9
212 changed files with 49462 additions and 416 deletions
|
|
@ -54,6 +54,70 @@ public sealed class RuntimeInteractionTransactionStateTests
|
|||
|
||||
state.CompleteUse(0u);
|
||||
Assert.Equal(0, inventory.BusyCount);
|
||||
Assert.Equal(new RuntimeItemUseCompletion(1, Item, 0u, 0u),
|
||||
state.LastItemUseCompletion);
|
||||
Assert.False(state.CaptureOwnership().AwaitingItemUseCompletion);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TargetedItemUsePublishesExactAuthoritativeFailureReceipt()
|
||||
{
|
||||
using var inventory = NewInventory(out _);
|
||||
using var state = new RuntimeInteractionTransactionState(inventory);
|
||||
|
||||
Assert.True(state.TryDispatchTargetedUse(
|
||||
Item,
|
||||
Container,
|
||||
static (_, _) => { },
|
||||
incrementBusy: true));
|
||||
Assert.True(state.CaptureOwnership().AwaitingItemUseCompletion);
|
||||
|
||||
state.CompleteUse(0x0402u);
|
||||
|
||||
Assert.Equal(
|
||||
new RuntimeItemUseCompletion(1, Item, Container, 0x0402u),
|
||||
state.LastItemUseCompletion);
|
||||
Assert.False(state.LastItemUseCompletion.IsSuccess);
|
||||
Assert.False(state.CaptureOwnership().AwaitingItemUseCompletion);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UseDoneWithoutPluginItemRequestCannotFabricateItemReceipt()
|
||||
{
|
||||
using var inventory = NewInventory(out _);
|
||||
using var state = new RuntimeInteractionTransactionState(inventory);
|
||||
state.IncrementBusyCount();
|
||||
|
||||
state.CompleteUse(0u);
|
||||
|
||||
Assert.Equal(default, state.LastItemUseCompletion);
|
||||
Assert.Equal(0, inventory.BusyCount);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItemUseReceiptIsGenerationScoped()
|
||||
{
|
||||
using var inventory = NewInventory(out _);
|
||||
using var state = new RuntimeInteractionTransactionState(inventory);
|
||||
Assert.True(state.TryDispatchTargetedUse(
|
||||
Item,
|
||||
Container,
|
||||
static (_, _) => { },
|
||||
incrementBusy: true));
|
||||
state.CompleteUse(0u);
|
||||
Assert.True(state.LastItemUseCompletion.IsSuccess);
|
||||
|
||||
state.ResetSession();
|
||||
|
||||
Assert.Equal(default, state.LastItemUseCompletion);
|
||||
Assert.True(state.TryDispatchTargetedUse(
|
||||
Container,
|
||||
Item,
|
||||
static (_, _) => { },
|
||||
incrementBusy: true));
|
||||
state.CompleteUse(0u);
|
||||
Assert.Equal(1, state.LastItemUseCompletion.Revision);
|
||||
Assert.Equal(Container, state.LastItemUseCompletion.SourceObjectId);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue