public async void ShouldNotBeAbleToCreatePoWhenNotRegisteredCaller() { // Try to create a PO sent by a non-authorised user, it should fail // Prepare a new PO Purchasing.Po poAsRequested = await CreatePurchasingPoAsync(quoteId : GetRandomInt(), eShopId : GetRandomString()); var signature = poAsRequested.ToBuyerPo().GetSignatureBytes(_contracts.Web3); // Request creation of new PO using preexisting Purchasing contract, but with tx executed by the non-authorised ("secondary") user await Task.Delay(1); var ps = new PurchasingService(_contracts.Web3SecondaryUser, _contracts.Deployment.PurchasingService.ContractHandler.ContractAddress); Func <Task> act = async() => await ps.CreatePurchaseOrderRequestAndWaitForReceiptAsync(poAsRequested, signature); act.Should().Throw <SmartContractRevertException>().WithMessage(AUTH_EXCEPTION_ONLY_REGISTERED); }