Skip to content

Commit

Permalink
[unity] disable ut also
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieyang committed Jul 28, 2022
1 parent 98f4672 commit 8b568c7
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions unity/general/Src/UnitTest/GenTest.cs
Expand Up @@ -11,62 +11,62 @@ class Singleton2<T> where T: class, new() {}
[TestFixture]
public class GenUnitTest
{
[Test]
public void GenericWrapper()
{
// [Test]
// public void GenericWrapper()
// {

var jsEnv = new JsEnv(new TxtLoader());
var wrapRender = jsEnv.Eval<Func<Editor.Generator.Wrapper.StaticWrapperInfo, string>>("require('puerts/templates/wrapper.tpl.cjs')");
var genList = new List<Type>() { typeof(Dictionary<int, JsEnv>) };
Editor.Generator.Wrapper.StaticWrapperInfo wrapperInfo = Editor.Generator.Wrapper.StaticWrapperInfo.FromType(typeof(Dictionary<int, JsEnv>), genList);
// var jsEnv = new JsEnv(new TxtLoader());
// var wrapRender = jsEnv.Eval<Func<Editor.Generator.Wrapper.StaticWrapperInfo, string>>("require('puerts/templates/wrapper.tpl.cjs')");
// var genList = new List<Type>() { typeof(Dictionary<int, JsEnv>) };
// Editor.Generator.Wrapper.StaticWrapperInfo wrapperInfo = Editor.Generator.Wrapper.StaticWrapperInfo.FromType(typeof(Dictionary<int, JsEnv>), genList);

string wrapperContent = wrapRender(wrapperInfo);
Assert.True(wrapperContent.Contains("<T>"));
}
// string wrapperContent = wrapRender(wrapperInfo);
// Assert.True(wrapperContent.Contains("<T>"));
// }

[Test]
public void GenericWrapper_2()
{
// [Test]
// public void GenericWrapper_2()
// {

var jsEnv = new JsEnv(new TxtLoader());
var wrapRender = jsEnv.Eval<Func<Editor.Generator.Wrapper.StaticWrapperInfo, string>>("require('puerts/templates/wrapper.tpl.cjs')");
var genList = new List<Type>() {
typeof(Dictionary<Type, JsEnv>)
};
Editor.Generator.Wrapper.StaticWrapperInfo wrapperInfo = Editor.Generator.Wrapper.StaticWrapperInfo.FromType(typeof(Dictionary<Type, JsEnv>), genList);
// var jsEnv = new JsEnv(new TxtLoader());
// var wrapRender = jsEnv.Eval<Func<Editor.Generator.Wrapper.StaticWrapperInfo, string>>("require('puerts/templates/wrapper.tpl.cjs')");
// var genList = new List<Type>() {
// typeof(Dictionary<Type, JsEnv>)
// };
// Editor.Generator.Wrapper.StaticWrapperInfo wrapperInfo = Editor.Generator.Wrapper.StaticWrapperInfo.FromType(typeof(Dictionary<Type, JsEnv>), genList);

string wrapperContent = wrapRender(wrapperInfo);
Assert.True(wrapperContent.Contains("<T,S>"));
}
// string wrapperContent = wrapRender(wrapperInfo);
// Assert.True(wrapperContent.Contains("<T,S>"));
// }

[Test]
public void GenericWrapper_3()
{
var jsEnv = new JsEnv(new TxtLoader());
var wrapRender = jsEnv.Eval<Func<Editor.Generator.Wrapper.StaticWrapperInfo, string>>("require('puerts/templates/wrapper.tpl.cjs')");
var genList = new List<Type>() {
typeof(Singleton1<Zombie>),
typeof(Zombie)
};
Editor.Generator.Wrapper.StaticWrapperInfo wrapperInfo = Editor.Generator.Wrapper.StaticWrapperInfo.FromType(typeof(Singleton1<Zombie>), genList);
// [Test]
// public void GenericWrapper_3()
// {
// var jsEnv = new JsEnv(new TxtLoader());
// var wrapRender = jsEnv.Eval<Func<Editor.Generator.Wrapper.StaticWrapperInfo, string>>("require('puerts/templates/wrapper.tpl.cjs')");
// var genList = new List<Type>() {
// typeof(Singleton1<Zombie>),
// typeof(Zombie)
// };
// Editor.Generator.Wrapper.StaticWrapperInfo wrapperInfo = Editor.Generator.Wrapper.StaticWrapperInfo.FromType(typeof(Singleton1<Zombie>), genList);

string wrapperContent = wrapRender(wrapperInfo);
Assert.False(wrapperContent.Contains("<T>"));
}
// string wrapperContent = wrapRender(wrapperInfo);
// Assert.False(wrapperContent.Contains("<T>"));
// }

[Test]
public void GenericWrapper_4()
{
var jsEnv = new JsEnv(new TxtLoader());
var wrapRender = jsEnv.Eval<Func<Editor.Generator.Wrapper.StaticWrapperInfo, string>>("require('puerts/templates/wrapper.tpl.cjs')");
var genList = new List<Type>() {
typeof(Singleton2<Zombie>),
typeof(Zombie)
};
Editor.Generator.Wrapper.StaticWrapperInfo wrapperInfo = Editor.Generator.Wrapper.StaticWrapperInfo.FromType(typeof(Singleton2<Zombie>), genList);
// [Test]
// public void GenericWrapper_4()
// {
// var jsEnv = new JsEnv(new TxtLoader());
// var wrapRender = jsEnv.Eval<Func<Editor.Generator.Wrapper.StaticWrapperInfo, string>>("require('puerts/templates/wrapper.tpl.cjs')");
// var genList = new List<Type>() {
// typeof(Singleton2<Zombie>),
// typeof(Zombie)
// };
// Editor.Generator.Wrapper.StaticWrapperInfo wrapperInfo = Editor.Generator.Wrapper.StaticWrapperInfo.FromType(typeof(Singleton2<Zombie>), genList);

string wrapperContent = wrapRender(wrapperInfo);
Assert.True(wrapperContent.Contains("<T>"));
}
// string wrapperContent = wrapRender(wrapperInfo);
// Assert.True(wrapperContent.Contains("<T>"));
// }
}
}

0 comments on commit 8b568c7

Please sign in to comment.