Esempio n. 1
0
        public void ClaimMonsterCollectReward(string addressString, int expectedCode)
        {
            var filePath   = Path.Combine(Path.GetTempPath(), Path.GetTempFileName());
            var resultCode = _command.ClaimMonsterCollectionReward(addressString, filePath);

            Assert.Equal(expectedCode, resultCode);

            if (resultCode == 0)
            {
                var    rawAction = Convert.FromBase64String(File.ReadAllText(filePath));
                var    decoded   = (List)_codec.Decode(rawAction);
                string type      = (Text)decoded[0];
                Assert.Equal(nameof(Nekoyume.Action.ClaimMonsterCollectionReward), type);

                Dictionary plainValue = (Dictionary)decoded[1];
                var        action     = new ClaimMonsterCollectionReward();
                action.LoadPlainValue(plainValue);
                Assert.Equal(new Address(addressString), action.avatarAddress);
            }
            else
            {
                Assert.Contains("System.FormatException: Could not find any recognizable digits.", _console.Error.ToString());
            }
        }