public async Task Commit_CommitsTransaction() { // Arrange var service = new Service(); var storage = new MemoryStorage(); var trans = TransactionFactory.CreateNew(storage); trans = await storage.CreateTransactionAsync(trans); service.Transaction = trans; // Act service.CompileAndRun(@"module foo; await commit this; "); // Assert Assert.Equal(2, (await storage.FetchTransactionAsync(trans.Id)).Revision); }
public async Task Commit_WithExpression_CommitsTransaction() { // Arrange var service = new Service(); var storage = new MemoryStorage(); var trans = TransactionFactory.CreateNew(storage); trans = await storage.CreateTransactionAsync(trans); service.Transaction = trans; // Act service.CompileAndRun(@"module foo; await commit this with { Script: ""Foo"" }; "); // Assert Assert.Equal("Foo", (await storage.FetchTransactionAsync(trans.Id)).Script); }