예제 #1
0
        public void TestEmptyContract()
        {
            SolidityContract contract = new SolidityContract("foo");

            var actual   = contract.ToString();
            var expected = "contract foo { \n }";

            Assert.Equal(expected, actual);
        }
예제 #2
0
        public void TestSingleInheritance()
        {
            SolidityContract contract = new SolidityContract("foo");

            contract.AddInheritance("Bar1");

            var actual   = contract.ToString();
            var expected = "contract foo is Bar1{ \n }";

            Assert.Equal(expected, actual);
        }
예제 #3
0
        public void TestContractWithFunction()
        {
            SolidityContract contract = new SolidityContract("foo");

            contract.AddComponent(new SolidityFunction("bar", SolidityVisibility.Public));

            var actual   = contract.ToString();
            var expected = "contract foo { \n" +
                           "\tfunction bar() public {\n" +
                           "\t}\n" +
                           "\n }";

            Assert.Equal(expected, actual);
        }