Skip to content

Commit

Permalink
change scdl version to 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
umutonat committed Jul 29, 2020
1 parent 5e770b9 commit d5e1498
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
9 changes: 0 additions & 9 deletions SCTransformation.UnitTests/Constants.cs

This file was deleted.

9 changes: 9 additions & 0 deletions SCTransformation.UnitTests/SCTransformation.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,13 @@
<ProjectReference Include="..\SCTransformation\SCTransformation.csproj" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\in.go" />
<EmbeddedResource Include="Resources\in.go" />
<None Remove="Resources\in.js" />
<EmbeddedResource Include="Resources\in.js" />
<None Remove="Resources\in.sol" />
<EmbeddedResource Include="Resources\in.sol" />
</ItemGroup>

</Project>
26 changes: 20 additions & 6 deletions SCTransformation.UnitTests/ScdGeneratorTests.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Xunit;
using SCTransformation.Models;

namespace SCTransformation.UnitTests
{
public class ScdGeneratorTests
{
private Assembly _assembly;
private string _solidityResourceName;
private string _javaScriptResourceName;
private string _goResourceName;

public ScdGeneratorTests()
{
_assembly = Assembly.GetExecutingAssembly();
_solidityResourceName = "SCTransformation.UnitTests.Resources.in.sol";
_javaScriptResourceName = "SCTransformation.UnitTests.Resources.in.js";
_goResourceName = "SCTransformation.UnitTests.Resources.in.go";
}

[Fact]
public void TestTransformJavaScriptEqual()
{
Expand Down Expand Up @@ -70,8 +84,8 @@ public void TestTransformJavaScriptEqual()
}
};

var test = SmartContractDescriptorGenerator.Transform(File.ReadAllText(
Constants.JavaScriptPath),
var test = SmartContractDescriptorGenerator.Transform(
new StreamReader(_assembly.GetManifestResourceStream(_javaScriptResourceName)!).ReadToEnd(),
"JavaScript");

Assert.NotNull(test);
Expand Down Expand Up @@ -183,8 +197,8 @@ public void TestTransformSolidityEqual()
}
};

var test = SmartContractDescriptorGenerator.Transform(File.ReadAllText(
Constants.SolidityInPath),
var test = SmartContractDescriptorGenerator.Transform(
new StreamReader(_assembly.GetManifestResourceStream(_solidityResourceName)!).ReadToEnd(),
"Solidity");

Assert.NotNull(test);
Expand Down Expand Up @@ -253,8 +267,8 @@ public void TestTransformGoEqual()
}
};

var test = SmartContractDescriptorGenerator.Transform(File.ReadAllText(
Constants.GoPath), "Go");
var test = SmartContractDescriptorGenerator.Transform(
new StreamReader(_assembly.GetManifestResourceStream(_goResourceName)!).ReadToEnd(), "Go");

Assert.NotNull(test);
Assert.Equal(smartContractDescriptor.Name, test.Name);
Expand Down
2 changes: 1 addition & 1 deletion SCTransformation/Helpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public static class Constants
{
public const string ScdlVersion = "1.0";
public const string ScdlVersion = "1.1";
public const string Solidity = "Solidity";
public const string Go = "Go";
public const string JavaScript = "JavaScript";
Expand Down

0 comments on commit d5e1498

Please sign in to comment.