Beispiel #1
0
        public async Task ShouldGetTotalNftTemplateTypes()
        {
            // Arrange
            var getNftRequest = new GetNftCountServiceRequest();

            // Act
            GetNftCountServiceResponse response = await Mediator.Send(getNftRequest);

            //Assert
            //response.TotalNftTypes.ShouldBeGreaterThan(2);
            response.NftCount.ShouldNotBeNull();
        }
Beispiel #2
0
        public async Task ShouldAddNewNftTemplate()
        {
            // Arrange
            Function <AddNewTemplateFunctionInput> aAddNewTemplateFunction = NftCreator.Instance.GetFunction <AddNewTemplateFunctionInput>();

            Nethereum.Contracts.ContractHandlers.IContractTransactionHandler <AddNewTemplateFunctionInput> addNewTemplateFunctionHandler = NethWeb3.Instance.Eth.GetContractTransactionHandler <AddNewTemplateFunctionInput>();

            var getNftRequest = new GetNftCountServiceRequest();

            GetNftCountServiceResponse totalTypesBeforeTest = await Mediator.Send(getNftRequest);

            var aAddNewTemplateFunctionMessage = new AddNewTemplateFunctionInput
            {
                NewTemplateName           = "Purchase Order",
                NewTemplateSymbol         = "POR",
                NewTemplateAttachedTokens = 0,
                NewTemplateMintLimit      = 10
            };

            Nethereum.Hex.HexTypes.HexBigInteger gasEstimate = await addNewTemplateFunctionHandler.EstimateGasAsync(NftCreatorAddresses.NewNftCreatorRopstenAddress, aAddNewTemplateFunctionMessage);

            aAddNewTemplateFunctionMessage.Gas = gasEstimate.Value;

            gasEstimate.Value.ShouldBeGreaterThan(0);

            // Leaving this commented out as this is the action that makes a new template
            // it's been tested and works

            //Nethereum.RPC.Eth.DTOs.TransactionReceipt addingTemplateTransactionReceipt = await addNewTemplateFunctionHandler.SendRequestAndWaitForReceiptAsync(NftCreatorAddresses.NftCreatorRinkebyAddress, aAddNewTemplateFunctionMessage);

            //addingTemplateTransactionReceipt.ShouldNotBe(null);


            //GetNftTypesServiceResponse totalTypesAfterTest = await Mediator.Send(getNftRequest);


            //totalTypesAfterTest.TotalNftTypes.ShouldBeGreaterThan(totalTypesBeforeTest.TotalNftTypes);
        }