public void OnNonFungibleTokenReceived_GetOwner_Call_Raise_Exception_Fails() { SetupMessage(creator, 0); var store = new NFTStore(mContractState.Object); SetupGetOwnerOfToken(TransferResult.Failed()); SetupMessage(tokenContract, 0); var price = 5_00_000_000ul; var priceBytes = BitConverter.GetBytes(price); mSerializer.Setup(m => m.ToUInt64(priceBytes)).Returns(price); store.Invoking(s => s.OnNonFungibleTokenReceived(tokenOwner, tokenOwner, tokenId, priceBytes)) .Should() .Throw <SmartContractAssertException>() .WithMessage("OwnerOf method call failed."); }
public void CancelSale_SafeTokenTransfer_Returns_False_Fails() { SetupMessage(creator, 0); var store = new NFTStore(mContractState.Object); var saleInfo = new SaleInfo { Price = 100, Seller = tokenOwner }; SetSaleInfo(saleInfo); SetupMessage(tokenOwner, 0); SetupSafeTransferToken(contract, tokenOwner, tokenId, TransferResult.Failed()); store.Invoking(s => s.CancelSale(tokenContract, tokenId)) .Should() .Throw <SmartContractAssertException>() .WithMessage("The token transfer failed."); }