2019-12-07 02:54:27 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
2019-10-31 02:24:42 +00:00
|
|
|
|
using Wabbajack.Lib.CompilationSteps;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Test
|
|
|
|
|
{
|
|
|
|
|
[TestClass]
|
|
|
|
|
public class CompilationStackTests : ACompilerTest
|
|
|
|
|
{
|
|
|
|
|
[TestMethod]
|
2019-12-07 02:54:27 +00:00
|
|
|
|
public async Task TestStackSerialization()
|
2019-10-31 02:24:42 +00:00
|
|
|
|
{
|
|
|
|
|
var profile = utils.AddProfile();
|
|
|
|
|
var mod = utils.AddMod("test");
|
|
|
|
|
|
|
|
|
|
utils.Configure();
|
2019-12-07 02:54:27 +00:00
|
|
|
|
var compiler = await ConfigureAndRunCompiler(profile);
|
2019-10-31 02:24:42 +00:00
|
|
|
|
var stack = compiler.MakeStack();
|
|
|
|
|
|
|
|
|
|
var serialized = Serialization.Serialize(stack);
|
|
|
|
|
var rounded = Serialization.Serialize(Serialization.Deserialize(serialized, compiler));
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual(serialized, rounded);
|
|
|
|
|
|
|
|
|
|
Assert.IsNotNull(compiler.GetStack());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|