Amend
This commit is contained in:
17
tests/BaseTest.cs
Normal file
17
tests/BaseTest.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using Skeleton.Algebra;
|
||||||
|
|
||||||
|
namespace Skeleton.Test;
|
||||||
|
|
||||||
|
public class BaseTest
|
||||||
|
{
|
||||||
|
protected static int Seed = 517515;
|
||||||
|
|
||||||
|
protected static class Theory<TDim, TField>
|
||||||
|
{
|
||||||
|
public static readonly Action<CategoryOf<TDim>.OnField<TField>.FMatrix> OnFail
|
||||||
|
= x => Console.WriteLine(x.CSharpRepresentation);
|
||||||
|
}
|
||||||
|
|
||||||
|
//protected static Action<TMatrix> TheoryOnFail<TMatrix>() = x => Console.WriteLine();
|
||||||
|
}
|
||||||
15
tests/GlobalSetUp.cs
Normal file
15
tests/GlobalSetUp.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using Skeleton.Utils.RandomEngines;
|
||||||
|
|
||||||
|
namespace Skeleton.Test;
|
||||||
|
[SetUpFixture]
|
||||||
|
public class GlobalSetUp
|
||||||
|
{
|
||||||
|
private const int RandomSeed = 33659722;
|
||||||
|
|
||||||
|
/*[SetUp]
|
||||||
|
public void SetUp()
|
||||||
|
{
|
||||||
|
RandomSource.SetSeed(RandomSeed);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
}
|
||||||
38
tests/RandomFixTest.cs
Normal file
38
tests/RandomFixTest.cs
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Skeleton.Samples;
|
||||||
|
using Skeleton.Utils.Helpers;
|
||||||
|
using Skeleton.Utils.RandomEngines;
|
||||||
|
|
||||||
|
namespace Skeleton.Test;
|
||||||
|
|
||||||
|
public class RandomFixTest : BaseTest
|
||||||
|
{
|
||||||
|
[DatapointSource] private static readonly IEnumerable<LieSU3> x =
|
||||||
|
40.WithSeed(771202).ScaleSamples(-1, 1).LieSU3LogSU3Samples().ToArray();
|
||||||
|
[Test]
|
||||||
|
public static void DatapointTest()
|
||||||
|
{
|
||||||
|
Assert.AreEqual(x.Count(), 36);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public static void Test(){
|
||||||
|
Console.WriteLine(RandomSource.Rnd.Value.NextDouble());
|
||||||
|
Console.WriteLine(RandomSource.Rnd.Value.NextDouble());
|
||||||
|
Console.WriteLine(RandomSource.Rnd.Value.NextDouble());
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public static void SampleTest()
|
||||||
|
{
|
||||||
|
RandomSource.SetSeed(22222);
|
||||||
|
LieSU3[] a = 40.ScaleSamples(-1, 1).LieSU3LogSU3Samples().ToArray();
|
||||||
|
RandomSource.SetSeed(22222);
|
||||||
|
LieSU3[] b = 40.ScaleSamples(-1, 1).LieSU3LogSU3Samples().ToArray();
|
||||||
|
Assert.AreEqual(a.Length, b.Length);
|
||||||
|
Console.WriteLine(a.Length);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user