I have written an unit test but when I launch it I get following error:
Test.sol:25:22: TypeError:
Member "val1" not found or not visible after argument-dependent lookup in function () view external returns (string s1, string s2, uint256 val1 memory,uint256,uint256,uint256,uint256,address).
Assert.equal(partProductionContract.production.val1, _val1, "msg.sender: ");
^------------------------------------------^
Compilation failed. See above.
Truffle v5.0.1 (core: 5.0.1)
Node v11.6.0
I don know what could be te problem, so I post some pieces of the smart contract and of the test function:
contract PartProduction {
struct Production {
string s1;
string s2;
uint256 val1;
}
Production public production;
constructor(
string s1,
string s2,
string val1,
)public {
production.s1 = s1;
production.s2 = s2;
production.val1 = _val1;
}
}
This is the unit test function:
contract Test {
// The address of the adoption contract to be tested
PartProduction public partProductionContract = PartProduction(DeployedAddresses.PartProduction());
function testSetParameters() public {
string memory _val1 = "someString";
Assert.equal(partProductionContract.production.val1, _val1, "msg.sender: ");
}
}